-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathplanarityHelp.c
123 lines (109 loc) · 5.48 KB
/
planarityHelp.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*
Copyright (c) 1997-2025, John M. Boyer
All rights reserved.
See the LICENSE.TXT file for licensing information.
*/
#include "planarity.h"
char *GetProjectTitle(void)
{
static char projectTitle[MAXLINE + 1];
sprintf(projectTitle,
"\n==================================================="
"\nThe Edge Addition Planarity Suite version %s"
"\nbased on libPlanarity graph library version %s"
"\nCopyright (c) 1997-2025 by John M. Boyer"
"\nAll rights reserved."
"\nSee the LICENSE.TXT file for licensing information."
"\nContact info: jboyer at acm.org"
"\n===================================================\n",
gp_GetProjectVersionFull(),
gp_GetLibPlanarityVersionFull());
return projectTitle;
}
/****************************************************************************
helpMessage()
****************************************************************************/
int helpMessage(char *param)
{
Message(GetProjectTitle());
if (param == NULL)
{
Message(
"'planarity': if no command-line, then menu-driven\n"
"'planarity (-h|-help)': this message\n"
"'planarity (-h|-help) -menu': more help with menu-based command line\n"
"'planarity (-i|-info): copyright and license information\n"
"'planarity -test [-q] [samples dir]': runs tests (optional quiet mode)\n"
"\n");
Message(
"Common usages\n"
"-------------\n"
"planarity -s -q -p infile.txt embedding.out [obstruction.out]\n"
"Process infile.txt in quiet mode (-q), putting planar embedding in \n"
"embedding.out or (optionally) a Kuratowski subgraph in Obstruction.out\n"
"Process returns 0=planar, 1=nonplanar, -1=error\n"
"\n"
"planarity -s -q -d infile.txt embedding.out [drawing.out]\n"
"If graph in infile.txt is planar, then put embedding in embedding.out \n"
"and (optionally) an ASCII art drawing in drawing.out\n"
"Process returns 0=planar, 1=nonplanar, -1=error\n");
}
else if (strcmp(param, "-i") == 0 || strcmp(param, "-info") == 0)
{
Message(
"Includes a reference implementation of the following:\n"
"\n"
"* John M. Boyer. \"Subgraph Homeomorphism via the Edge Addition Planarity \n"
" Algorithm\". Journal of Graph Algorithms and Applications, Vol. 16, \n"
" no. 2, pp. 381-410, 2012. http://dx.doi.org/10.7155/jgaa.00268\n"
"\n"
"* John M. Boyer. \"A New Method for Efficiently Generating Planar Graph\n"
" Visibility Representations\". In P. Eades and P. Healy, editors,\n"
" Proceedings of the 13th International Conference on Graph Drawing 2005,\n"
" Lecture Notes Comput. Sci., Volume 3843, pp. 508-511, Springer-Verlag, 2006.\n"
" http://dx.doi.org/10.1007/11618058_47\n"
"\n"
"* John M. Boyer and Wendy J. Myrvold. \"On the Cutting Edge: Simplified O(n)\n"
" Planarity by Edge Addition\". Journal of Graph Algorithms and Applications,\n"
" Vol. 8, No. 3, pp. 241-273, 2004. http://dx.doi.org/10.7155/jgaa.00091\n"
"\n"
"* John M. Boyer. \"Simplified O(n) Algorithms for Planar Graph Embedding,\n"
" Kuratowski Subgraph Isolation, and Related Problems\". Ph.D. Dissertation,\n"
" University of Victoria, 2001. https://dspace.library.uvic.ca/handle/1828/9918\n"
"\n");
}
else if (strcmp(param, "-menu") == 0)
{
Message(
"'planarity -r [-q] C K N [O]': Random graphs\n"
"'planarity -s [-q] C I O [O2]': Specific graph\n"
"'planarity -rm [-q] N O [O2]': Random maximal planar graph\n"
"'planarity -rn [-q] N O [O2]': Random nonplanar graph (maximal planar + edge)\n"
"'planarity -t [-q] C I O': Test algorithm on graph(s) in .g6 file\n"
"'planarity -x [-q] -(gam) I O': Transform graph to .g6 (g), Adjacency List (a), or Adjacency Matrix (m)\n"
"'planarity I O [-n O2]': Legacy command-line (default -s -p)\n"
"\n");
Message("-q is for quiet mode (no messages to stdout and stderr)\n\n");
Message(GetAlgorithmFlags());
Message(
"K = # of graphs to randomly generate\n"
"N = # of vertices in each randomly generated graph\n"
"I = Input file (for work on a specific graph)\n"
"O = Primary output file\n"
" For example, if C=-p then O receives the planar embedding\n"
" If C=-3, then O receives a subgraph containing a K_{3,3}\n"
"O2= Secondary output file\n"
" For -s, if C=-p or -o, then O2 receives the embedding obstruction\n"
" For -s, if C=-d, then O2 receives a drawing of the planar graph\n"
" For -rm and -rn, O2 contains the original randomly generated graph\n"
"\n");
Message(
"planarity process results: 0=OK, -1=NOTOK, 1=NONEMBEDDABLE\n"
" 1 result only produced by specific graph mode (-s)\n"
" with command -2,-3,-4: found K_{2,3}, K_{3,3} or K_4\n"
" with command -p,-d: found planarity obstruction\n"
" with command -o: found outerplanarity obstruction\n");
}
FlushConsole(stdout);
return OK;
}