category
undirected_graph_common
Common predicates shared by undirected graph objects. Uses self-dispatch to call object-specific predicates such as is_connected/1, vertices/2, edges/2, and neighbors/3.
logtalk_load(graphs(loader))staticPublic predicates
is_tree/1
True iff the graph is a tree, i.e. it is connected and has exactly |V| - 1 edges.
staticis_tree(Graph)is_tree(+graph) - zero_or_onehas_cycle/1
True iff the graph contains at least one cycle.
statichas_cycle(Graph)has_cycle(+graph) - zero_or_onecycle/2
Enumerates cycles as lists of vertices where the first and last vertices are the same.
staticcycle(Graph,Cycle)cycle(+graph,-list(vertex)) - zero_or_moregraph_coloring/3
Computes a greedy vertex coloring of the graph. Coloring is a list of Vertex-Color pairs where colors are integers starting from 1. NumberOfColors is the total number of colors used.
staticgraph_coloring(Graph,Coloring,NumberOfColors)graph_coloring(+graph,-list(pair),-integer) - onearticulation_points/2
Computes all articulation points (cut vertices) of the graph. The result is a sorted list of vertices.
staticarticulation_points(Graph,Points)articulation_points(+graph,-list(vertex)) - onebridges/2
Computes all bridges (cut edges) of the graph. Each bridge is returned once as Vertex1-Vertex2 with Vertex1 @< Vertex2.
staticbridges(Graph,Bridges)bridges(+graph,-list(edge)) - onemaximal_cliques/2
Computes all maximal cliques of the graph using the Bron-Kerbosch algorithm with pivoting. A maximal clique is a clique that cannot be extended by adding another adjacent vertex. Each clique is a sorted list of vertices. The list of cliques is sorted in standard order.
staticmaximal_cliques(Graph,Cliques)maximal_cliques(+graph,-list(list(vertex))) - onemaximum_cliques/2
Computes all maximum cliques of the graph, i.e. the largest maximal cliques. Each clique is a sorted list of vertices. The list of cliques is sorted in standard order. For an empty graph, returns an empty list.
staticmaximum_cliques(Graph,Cliques)maximum_cliques(+graph,-list(list(vertex))) - oneProtected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)