category

weighted_graph_common(Dictionary)

Common weighted graph predicates shared by both weighted directed and weighted undirected graph objects. Uses self-dispatch to call object-specific predicates such as add_edge/5, delete_edge/5, and edges/2.

Availability:
logtalk_load(graphs(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-02-25
Compilation flags:
static
Implements:
Extends:
Uses:
Remarks:
(none)

Public predicates

(no local declarations; see entity ancestors if any)

Protected predicates

winsert_neighbor/4

Inserts a weighted neighbor into a sorted weighted neighbor list, replacing any existing entry for the same vertex.

Compilation flags:
static
Template:
winsert_neighbor(WNeighbors,Vertex,Weight,NewWNeighbors)
Mode and number of proofs:
winsert_neighbor(+list,+vertex,+number,-list) - one

wremove_neighbor/4

Removes a vertex from a sorted weighted neighbor list, unifying the weight. Fails if the vertex is not found.

Compilation flags:
static
Template:
wremove_neighbor(WNeighbors,Vertex,Weight,NewWNeighbors)
Mode and number of proofs:
wremove_neighbor(+list,+vertex,-number,-list) - zero_or_one

wfind/3

Finds the weight associated with a vertex in a weighted neighbor list.

Compilation flags:
static
Template:
wfind(WNeighbors,Vertex,Weight)
Mode and number of proofs:
wfind(+list,+vertex,-number) - zero_or_one

wremove_vertex_from_all/3

Removes a vertex from all weighted neighbor lists in a list of vertex-neighbors pairs.

Compilation flags:
static
Template:
wremove_vertex_from_all(Pairs,Vertex,NewPairs)
Mode and number of proofs:
wremove_vertex_from_all(+list(pair),+vertex,-list(pair)) - one

relax_neighbors/7

Relaxes neighbors during Dijkstra shortest path computation, updating distances and priority queue.

Compilation flags:
static
Template:
relax_neighbors(WNeighbors,Vertex,Distance,Queue,Dist,NewQueue,NewDist)
Mode and number of proofs:
relax_neighbors(+list,+vertex,+number,+list,+dictionary,-list,-dictionary) - one

pq_insert/3

Inserts an element into a sorted priority queue (list of Distance-Vertex pairs).

Compilation flags:
static
Template:
pq_insert(Queue,Item,NewQueue)
Mode and number of proofs:
pq_insert(+list,+pair,-list) - one

Private predicates

(no local declarations; see entity ancestors if any)

Operators

(none)