Author(s): M. Carlsson, adapted from shared code written by Richard A O'Keefe. Mods by F.Bueno and M.Carro..
Version: 1.11#222 (2004/5/24, 13:8:7 CEST)
Version of last change: 1.11#64 (2003/12/9, 7:11:15 CET)
An unweighted directed graph (ugraph) is represented as a list of (vertex-neighbors) pairs, where the pairs are in standard order (as produced by keysort with unique keys) and the neighbors of each vertex are also in standard order (as produced by sort), and every neighbor appears as a vertex even if it has no neighbors itself.
An undirected graph is represented as a directed graph where for each edge (U,V)
there is a symmetric edge (V,U)
.
An edge (U,V)
is represented as the term U-V
.
A vertex can be any term. Two vertices are distinct iff they are not identical (
==/2
).
A path is represented as a list of vertices. No vertex can appear twice in a path.
ugraphs
):- use_module(library(ugraphs)).
ugraphs
)No further documentation available for this predicate.
Usage: neighbors(Vertex, Graph, Neighbors)
Vertex
is a vertex in Graph
and Neighbors
are its neighbors.
Vertex
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Graph
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Neighbors
is a free variable.
(term_typing:var/1
)
Usage: edges(Graph, Edges)
Edges
with the edges in Graph
.
Graph
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Edges
is a free variable.
(term_typing:var/1
)
Usage: del_vertices(Graph1, Vertices, Graph2)
Graph2
is Graph1
with Vertices
and all edges to and from Vertices
removed from it.
Graph1
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Vertices
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Graph2
is a free variable.
(term_typing:var/1
)
Usage: vertices(Graph, Vertices)
Vertices
with the vertices in Graph
.
Graph
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Vertices
is a free variable.
(term_typing:var/1
)
Usage: add_vertices(Graph1, Vertices, Graph2)
Graph2
is Graph1
with Vertices
added to it.
Graph1
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Vertices
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Graph2
is a free variable.
(term_typing:var/1
)
Usage: add_edges(Graph1, Edges, Graph2)
Graph2
is Graph1
with Edges
and their 'to' and 'from' vertices added to it.
Graph1
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Edges
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Graph2
is a free variable.
(term_typing:var/1
)
Usage: transpose(Graph, Transpose)
Transpose
is the graph computed by replacing each edge (u,v)
in Graph
by its symmetric edge (v,u)
. It can only be used one way around. The cost is O(N^2).
Graph
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Transpose
is a free variable.
(term_typing:var/1
)
Usage: rooted_subgraph(Graph, Sources, SubGraph)
SubGraph
is the subgraph of Graph
which is reachable from Sources
.
Graph
is an ugraph.
(ugraphs:ugraph/1
)
Sources
is a list.
(basic_props:list/1
)
SubGraph
is a free variable.
(term_typing:var/1
)
SubGraph
is an ugraph.
(ugraphs:ugraph/1
)
Usage: point_to(Vertex, Graph, Point_to)
Point_to
is the list of nodes which go directly to Vertex
in Graph
.
Vertex
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Graph
is currently a term which is not a free variable.
(term_typing:nonvar/1
)
Point_to
is a free variable.
(term_typing:var/1
)
Usage: ugraph(Graph)
Graph
is an ugraph.
Go to the first, previous, next, last section, table of contents.