**Author(s):** M. Carlsson, adapted from shared code written by Richard A O'Keefe. Mods by F.Bueno and M.Carro..

**Version:** 1.10#6 (2004/8/7, 21:46:39 CEST)

**Version of last change:** 0.9#105 (1999/6/4, 12:24:49 MEST)

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`

)`ugraphs`

)- PREDICATE:
**vertices_edges_to_ugraph/3:** -
No further documentation available for this predicate.

- PREDICATE:
**neighbors/3:** -
**Usage:**`neighbors(+Vertex, +Graph, -Neighbors)`

*Description:*Is true if`Vertex`

is a vertex in`Graph`

and`Neighbors`

are its neighbors.

- PREDICATE:
**edges/2:** -
**Usage:**`edges(+Graph, -Edges)`

*Description:*Unifies`Edges`

with the edges in`Graph`

.

- PREDICATE:
**del_vertices/3:** -
**Usage:**`del_vertices(+Graph1, +Vertices, -Graph2)`

*Description:*Is true if`Graph2`

is`Graph1`

with`Vertices`

and all edges to and from`Vertices`

removed from it.

- PREDICATE:
**vertices/2:** -
**Usage:**`vertices(+Graph, -Vertices)`

*Description:*Unifies`Vertices`

with the vertices in`Graph`

.

- PREDICATE:
**add_vertices/3:** -
**Usage:**`add_vertices(+Graph1, +Vertices, -Graph2)`

*Description:*Is true if`Graph2`

is`Graph1`

with`Vertices`

added to it.

- PREDICATE:
**add_edges/3:** -
**Usage:**`add_edges(+Graph1, +Edges, -Graph2)`

*Description:*Is true if`Graph2`

is`Graph1`

with`Edges`

and their 'to' and 'from' vertices added to it.

- PREDICATE:
**transpose/2:** -
**Usage:**`transpose(+Graph, -Transpose)`

*Description:*Is true if`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).

- PREDICATE:
**point_to/3:** -
**Usage:**`point_to(+Vertex, +Graph, -Point_to)`

*Description:*Is true if`Point_to`

is the list of nodes which go directly to`Vertex`

in`Graph`

.

- REGTYPE:
**ugraph/1:** -
**Usage:**`ugraph(Graph)`

*Description:*`Graph`

is an ugraph.

Go to the first, previous, next, last section, table of contents.