object

unweighted_directed_graph(Dictionary)

Unweighted directed graph predicates using a dictionary representation. The parametric object parameter is the dictionary to use for the graph representation.

Availability:
logtalk_load(graphs(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-02-20
Compilation flags:
static, context_switching_calls
Remarks:
(none)

Public predicates

compose/3

Composes NewGraph by connecting the drains of LeftGraph to the sources of RightGraph.

Compilation flags:
static
Template:
compose(LeftGraph,RightGraph,NewGraph)
Mode and number of proofs:
compose(+graph,+graph,-graph) - one

union/3

Unifies UnionGraph with the union of Graph1 and Graph2.

Compilation flags:
static
Template:
union(Graph1,Graph2,UnionGraph)
Mode and number of proofs:
union(+graph,+graph,-graph) - one

topological_sort/3

Difference list version of topological_sort/2 where Sorted0 is the tail of Sorted.

Compilation flags:
static
Template:
topological_sort(Graph,Sorted0,Sorted)
Mode and number of proofs:
topological_sort(+graph,+list(vertex),-list(vertex)) - one

leaves/2

Unifies Leaves with a sorted list of vertices with no outgoing edges.

Compilation flags:
static
Template:
leaves(Graph,Leaves)
Mode and number of proofs:
leaves(+graph,-list(vertex)) - one

transitive_reduction/2

Computes the transitive reduction of the graph. An edge Vertex1-Vertex2 is in the reduction iff it is in the graph and there is no other path of length >= 2 from Vertex1 to Vertex2.

Compilation flags:
static
Template:
transitive_reduction(Graph,Reduction)
Mode and number of proofs:
transitive_reduction(+graph,-graph) - one

Protected predicates

(no local declarations; see entity ancestors if any)

Private predicates

(no local declarations; see entity ancestors if any)

Operators

(none)