We generate all the 3-regular planar graphs based on K4. Referred to the algorithm M. Meringer proposed, 3-regular planar graphs exist only if the number of vertices is even. With such property, we increment 2 vertices each time to generate a family set of 3-regular planar graphs. Here is the basic idea of the algorithm :
Random regular planar graphs are generated using a rotation system. A rotation system means that the graph is represented in an adjacency list that has the clockwise order for the neighbours of each vertex. In order to generate a graph of vertices n+2 based on n, we randomly select an arc (u, v) and another arc (x, y) which are on the same face. Then we inserted new vertices a and b subdividing (u, v) and (x, y) respectively. Connecting a and b creates a new graph of vertices n+2. We iterates this process and create a family of 3-regular planar graphs.
The implementation is attached at di_gen.c. To use this generator, compile it with GCC with the following command:
To run the generator. Run the executable file di_gen.exe followed by two arguments: min_n and max_n
It will generate one set of graphs of size n for each n starting at min_n and going up to at most max_n. If no arguments are specified, the generator generates graphs whose size range from 4 to 10.
For each graph, the output format is as follows:
(line 1): number of vertices n_nodes
(line 2 to line (n_nodes -1)): each line starts with degree u, and followed by the list of neighbours of that particular vertex.
A example of the output graph is attached below:
To generate such a graph, use the following command*
Graph NO. | Num of Vertices | Size of Min. Dom Set | Time |
---|---|---|---|
1 | 40 | 11 | 0.047s |
2 | 42 | 11 | 0.062s |
3 | 44 | 12 | 0.094s |
4 | 46 | 12 | 0.062s |
5 | 48 | 13 | 0.188s |
6 | 50 | 13 | 0.234s |
7 | 80 | 22 | 75.13s |
8 | 90 | 24 | 25.35s |
9 | 96 | 26 | 51.54s |
4. Certificate to the output is attached at di_randGraphs_cert.txt