#ifndef PLANARITY_H1#define PLANARITY_H23/*4Planarity-Related Graph Algorithms Project5Copyright (c) 1997-2010, John M. Boyer6All rights reserved. Includes a reference implementation of the following:78* John M. Boyer. "Simplified O(n) Algorithms for Planar Graph Embedding,9Kuratowski Subgraph Isolation, and Related Problems". Ph.D. Dissertation,10University of Victoria, 2001.1112* John M. Boyer and Wendy J. Myrvold. "On the Cutting Edge: Simplified O(n)13Planarity by Edge Addition". Journal of Graph Algorithms and Applications,14Vol. 8, No. 3, pp. 241-273, 2004.1516* John M. Boyer. "A New Method for Efficiently Generating Planar Graph17Visibility Representations". In P. Eades and P. Healy, editors,18Proceedings of the 13th International Conference on Graph Drawing 2005,19Lecture Notes Comput. Sci., Volume 3843, pp. 508-511, Springer-Verlag, 2006.2021Redistribution and use in source and binary forms, with or without modification,22are permitted provided that the following conditions are met:2324* Redistributions of source code must retain the above copyright notice, this25list of conditions and the following disclaimer.2627* Redistributions in binary form must reproduce the above copyright notice, this28list of conditions and the following disclaimer in the documentation and/or29other materials provided with the distribution.3031* Neither the name of the Planarity-Related Graph Algorithms Project nor the names32of its contributors may be used to endorse or promote products derived from this33software without specific prior written permission.3435THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"36AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE37IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE38DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR39ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES40(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;41LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON42ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT43(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS44SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.45*/4647#ifdef __cplusplus48extern "C" {49#endif5051#include <string.h>52#include <stdlib.h>53#include <time.h>54#include <ctype.h>55#include "graph.h"56#include "platformTime.h"5758#include "graphK23Search.h"59#include "graphK33Search.h"60#include "graphK4Search.h"61#include "graphDrawPlanar.h"62#include "graphColorVertices.h"6364void ProjectTitle();65int helpMessage(char *param);6667/* Functions that call the Graph Library */68int SpecificGraph(char command, char *infileName, char *outfileName, char *outfile2Name);69int RandomGraph(char command, int extraEdges, int numVertices, char *outfileName, char *outfile2Name);70int RandomGraphs(char command, int, int);7172int makeg_main(char command, int argc, char *argv[]);7374/* Command line, Menu, and Configuration */75int commandLine(int argc, char *argv[]);76int legacyCommandLine(int argc, char *argv[]);77int menu();7879char Mode,80OrigOut,81EmbeddableOut,82ObstructedOut,83AdjListsForEmbeddingsOut,84quietMode;8586void Reconfigure();8788/* Low-level Utilities */89#define MAXLINE 102490char Line[MAXLINE];9192void Message(char *message);93void ErrorMessage(char *message);94void FlushConsole(FILE *f);95void Prompt(char *message);9697void SaveAsciiGraph(graphP theGraph, char *filename);9899int FilesEqual(char *file1Name, char *file2Name);100101int GetEmbedFlags(char command);102char *GetAlgorithmName(char command);103void AttachAlgorithm(graphP theGraph, char command);104105char *ConstructInputFilename(char *infileName);106char *ConstructPrimaryOutputFilename(char *infileName, char *outfileName, char command);107void WriteAlgorithmResults(graphP theGraph, int Result, char command, platform_time start, platform_time end, char *infileName);108109#ifdef __cplusplus110}111#endif112113#endif114115116