[ library(grasper) | Third Party Libraries | Reference Manual | Alphabetic Index ]

graph_labeling(+Graph, ++VertexHeuristic, ++EdgeHeuristic)

Labels a graph variable using VertexHeuristic and EdgeHeuristic.
Graph
A graph.
VertexHeuristic
'up' for starting vertex inclusion first / 'down' for starting vertex exclusion first.
EdgeHeuristic
'up' for starting edge inclusion first / 'down' for starting edge exclusion first.

Description

Labels a graph variable using VertexHeuristic and EdgeHeuristic.

Fail Conditions

Fails if Graph is not a graph variable, if VertexHeuristic is not in {down,up} or if EdgeHeuristic is not in {down,up}.

Examples

?- graph_labeling(G,down,up).
No.

?- V`::[]..[1,2], E`::[]..[[1,2],[2,1]], dirgraph(G,V,E), graph_labeling(G,d,up).
No.

?- V`::[]..[1,2], E`::[]..[[1,2],[2,1]], dirgraph(G,V,E), graph_labeling(G,down,u).
No.

?- V`::[]..[1,2], E`::[]..[[1,2],[2,1]], dirgraph(G,V,E), graph_labeling(G,down,up).
V = []
E = []
G = dirgraph([], [])
Yes ? ;

V = [2]
E = []
G = dirgraph([2], [])
Yes ? ;

V = [1]
E = []
G = dirgraph([1], [])
Yes ? ;

V = [1, 2]
E = [[1, 2], [2, 1]]
G = dirgraph([1, 2], [[1, 2], [2, 1]])
Yes ? ;

V = [1, 2]
E = [[1, 2]]
G = dirgraph([1, 2], [[1, 2]])
Yes ? ;

V = [1, 2]
E = [[2, 1]]
G = dirgraph([1, 2], [[2, 1]])
Yes ? ;

V = [1, 2]
E = []
G = dirgraph([1, 2], [])
Yes