Goto Chapter: Top 1 2 3 Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

3 Nauty Traces Interface
 3.1 Data Structures

3 Nauty Traces Interface

3.1 Data Structures

3.1-1 NautyGraphFromEdges
‣ NautyGraphFromEdges( edges )( function )

Returns: a list of two lists

This function takes as input a list edges whose entries are lists of length 2, consisting of the two (possibly equal) vertices of the edges. It returns two lists, the first is a list of vertices (source vertices) where an edge originates and the second a list of corresponding vertices (range vertices) where an edge terminates. Note that when the graph is undirected, the source vertex will always be less than or equal to the range.

gap> ng := NautyGraph( [ [1,2], [2,3], [3,4], [4,1], [3,2] ]);    
<A Nauty graph with on 4 vertices>
gap> NautyGraphFromEdges( EdgesOfNautyGraph(ng));
[ [ 1, 1, 2, 3 ], [ 2, 4, 3, 4 ] ]
gap> ng := NautyDiGraph( [ [1,2], [2,3], [3,4], [4,1], [3,2] ]);
<A directed Nauty graph on 4 vertices>
gap> NautyGraphFromEdges( EdgesOfNautyGraph(ng));               
[ [ 1, 2, 3, 3, 4 ], [ 2, 3, 2, 4, 1 ] ]

3.1-2 NautyColorData
‣ NautyColorData( list )( function )

Returns: two lists

This function takes as input a list of colours, which are non-negative integers. The list is interpreted as a map from the nodes of a graph to the colour of the node. This function returns two lists, called node_list and color_list. The list node_list is a permutation of the nodes sorted by the colour of the node as specified in the input. The second list color_list contains only 0,1. The two lists together encode the colour partition of the nodes, namely the list color_list contains a 0 in position i, if node_list[i] and node_list[i+1] have different colours. Thus, if the first entry 0 in color_list occurs in position j, then the nodes stored in node_list[k] for 1 ≤ k ≤ j all have colour list[1].

 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 Ind

generated by GAPDoc2HTML