![]() |
YAP 7.1.0
|
The following graph manipulation routines use the red-black tree library to try to avoid linear-time scans of the graph for all graph operations. More...
The following graph manipulation routines use the red-black tree library to try to avoid linear-time scans of the graph for all graph operations.
Graphs are represented as a red-black tree, where the key is the vertex, and the associated value is a list of vertices reachable from that vertex through an edge (ie, a list of edges)
class dgraph_new/1 |
dgraph_new(+ Graph)
Create a new directed graph This operation must be performed before trying to use the graph
class dgraph_add_edge/4 |
dgraph_add_edge(+ Graph, + N1, + N2, - NewGraph)
Unify NewGraph with a new graph obtained by adding the edge N1- N2 to the graph Graph
class dgraph_add_edges/3 |
dgraph_add_edges(+ Graph, + Edges, - NewGraph)
Unify NewGraph with a new graph obtained by adding the list of edges Edges to the graph Graph
class dgraph_add_vertices/3 |
dgraph_add_vertices(+ Graph, + Vertices, - NewGraph)
Unify NewGraph with a new graph obtained by adding the list of vertices Vertices to the graph Graph
class dgraph_add_vertex/3 |
dgraph_add_vertex(+ Graph, + Vertex, - NewGraph)
Unify NewGraph with a new graph obtained by adding vertex Vertex to the graph Graph
class dgraph_edges/2 |
dgraph_edges(+ Graph, - Edges)
Unify Edges with all edges appearing in graph Graph
class dgraph_vertices/2 |
dgraph_vertices(+ Graph, - Vertices)
Unify Vertices with all vertices appearing in graph Graph
class dgraph_neighbours/3 |
dgraph_neighbours(+ Vertex, + Graph, - Vertices)
Unify Vertices with the list of neighbours of vertex Vertex in Graph
class dgraph_neighbors/3 |
dgraph_neighbors(+ Vertex, + Graph, - Vertices)
Unify Vertices with the list of neighbors of vertex Vertex in Graph If the vertice is not in the graph fail
class dgraph_complement/2 |
dgraph_complement(+ Graph, - NewGraph)
Unify NewGraph with the graph complementary to Graph
class dgraph_del_edge/4 |
dgraph_del_edge(+ Graph, + N1, + N2, - NewGraph)
Succeeds if NewGraph unifies with a new graph obtained by removing the edge N1- N2 from the graph Graph Notice that no vertices are deleted
class dgraph_del_edges/3 |
dgraph_del_edges(+ Graph, + Edges, - NewGraph)
Unify NewGraph with a new graph obtained by removing the list of edges Edges from the graph Graph Notice that no vertices are deleted
class dgraph_del_vertex/3 |
dgraph_del_vertex(+ Graph, + Vertex, - NewGraph)
Unify NewGraph with a new graph obtained by deleting vertex Vertex and all the edges that start from or go to Vertex to the graph Graph
class dgraph_del_vertices/3 |
dgraph_del_vertices(+ Graph, + Vertices, - NewGraph)
Unify NewGraph with a new graph obtained by deleting the list of vertices Vertices and all the edges that start from or go to a vertex in Vertices to the graph Graph
class dgraph_transpose/2 |
dgraph_transpose(+ Graph, - Transpose)
Unify NewGraph with a new graph obtained from Graph by replacing all edges of the form V1-V2 by edges of the form V2-V1
class dgraph_transitive_closure/2 |
dgraph_transitive_closure(+ Graph, - Closure)
Unify Closure with the transitive closure of graph Graph
class dgraph_symmetric_closure/2 |
dgraph_symmetric_closure(+ Graph, - Closure)
Unify Closure with the symmetric closure of graph Graph, that is, if Closure contains an edge U-V it must also contain the edge V-U
class dgraph_top_sort/2 |
dgraph_top_sort(+ Graph, - Vertices)
Unify Vertices with the topological sort of graph Graph
class dgraph_top_sort/3 |
dgraph_top_sort(+ Graph, - Vertices, ? Vertices0)
Unify the difference list Vertices- Vertices0 with the topological sort of graph Graph
class ugraph_to_dgraph/2 |
ugraph_to_dgraph( +_UGraph_, -_Graph_)
Unify Graph with the directed graph obtain from UGraph, represented in the form used in the ugraphs unweighted graphs library
class dgraph_to_ugraph/2 |
dgraph_to_ugraph(+ Graph, - UGraph)
Unify UGraph with the representation used by the ugraphs unweighted graphs library, that is, a list of the form V-Neighbors, where V is a node and Neighbors the nodes children
class dgraph_edge/3 |
dgraph_edge(+ N1, + N2, + Graph)
Edge N1- N2 is an edge in directed graph Graph
class dgraph_min_path/5 |
dgraph_min_path(+ V1, + V1, + Graph, - Path, ? Costt)
Unify the list Path with the minimal cost path between nodes N1 and N2 in graph Graph Path Path has cost Cost
class dgraph_max_path/5 |
dgraph_max_path(+ V1, + V1, + Graph, - Path, ? Costt)
Unify the list Path with the maximal cost path between nodes N1 and N2 in graph Graph Path Path has cost Cost
class dgraph_min_paths/3 |
dgraph_min_paths(+ V1, + Graph, - Paths)
Unify the list Paths with the minimal cost paths from node N1 to the nodes in graph Graph
class dgraph_path/4 |
dgraph_path(+ Vertex, + Vertex1, + Graph, ? Path)
The path Path is a path starting at vertex Vertex in graph Graph and ending at path Vertex2
class dgraph_path/3 |
dgraph_path(+ Vertex, + Graph, ? Path)
The path Path is a path starting at vertex Vertex in graph Graph
class dgraph_isomorphic/4 |
dgraph_isomorphic(+ Vs, + NewVs, + G0, - GF)
Unify the list GF with the graph isomorphic to G0 where vertices in Vs map to vertices in NewVs
class dgraph_reachable/3 |
dgraph_reachable(+ Vertex, + Graph, ? Edges)
The path Path is a path starting at vertex Vertex in graph Graph
class dgraph_leaves/2 |
dgraph_leaves(+ Graph, ? Vertices)
The vertices Vertices have no outgoing edge in graph Graph