Skip to content

Commit af07124

Browse files
committed
planarity: follow upstream layout, add LICENSE.TXT
1 parent 0f2c064 commit af07124

56 files changed

Lines changed: 274 additions & 171 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include planarity_src/c/**/*.h
1+
recursive-include planarity_src/c *.h
22
include planarity_src/planarity.pyx
3-
include planarmap_src/src/*.h
3+
recursive-include planarmap_src/src *.h
44
include planarmap_src/planarmap.pyx

planarity_src/LICENSE.TXT

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
The Edge Addition Planarity Suite
2+
Copyright (c) 1997-2025, John M. Boyer
3+
All rights reserved. Includes a reference implementation of the following:
4+
5+
* John M. Boyer. "Subgraph Homeomorphism via the Edge Addition Planarity Algorithm".
6+
Journal of Graph Algorithms and Applications, Vol. 16, no. 2, pp. 381-410, 2012.
7+
http://dx.doi.org/10.7155/jgaa.00268
8+
9+
* John M. Boyer. "A New Method for Efficiently Generating Planar Graph
10+
Visibility Representations". In P. Eades and P. Healy, editors,
11+
Proceedings of the 13th International Conference on Graph Drawing 2005,
12+
Lecture Notes Comput. Sci., Volume 3843, pp. 508-511, Springer-Verlag, 2006.
13+
http://dx.doi.org/10.1007/11618058_47
14+
15+
* John M. Boyer and Wendy J. Myrvold. "On the Cutting Edge: Simplified O(n)
16+
Planarity by Edge Addition". Journal of Graph Algorithms and Applications,
17+
Vol. 8, No. 3, pp. 241-273, 2004.
18+
http://dx.doi.org/10.7155/jgaa.00091
19+
20+
* John M. Boyer. "Simplified O(n) Algorithms for Planar Graph Embedding,
21+
Kuratowski Subgraph Isolation, and Related Problems". Ph.D. Dissertation,
22+
University of Victoria, 2001.
23+
https://dspace.library.uvic.ca/handle/1828/9918
24+
25+
Redistribution and use in source and binary forms, with or without
26+
modification, are permitted provided that the following conditions are met:
27+
28+
* Redistributions of source code must retain the above copyright notice, this
29+
list of conditions and the following disclaimer.
30+
31+
* Redistributions in binary form must reproduce the above copyright notice,
32+
this list of conditions and the following disclaimer in the documentation
33+
and/or other materials provided with the distribution.
34+
35+
* Neither the name of The Edge Addition Planarity Suite nor the names of its
36+
contributors may be used to endorse or promote products derived from
37+
this software without specific prior written permission.
38+
39+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
40+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
42+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
43+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
44+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
45+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
46+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
48+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

planarity_src/c/graph.h

Lines changed: 10 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,25 @@
1-
#ifndef GRAPH_H
2-
#define GRAPH_H
1+
#ifndef HELPERSTUB_GRAPH_H
2+
#define HELPERSTUB_GRAPH_H
33

44
/*
55
Copyright (c) 1997-2025, John M. Boyer
66
All rights reserved.
77
See the LICENSE.TXT file for licensing information.
88
*/
99

10+
// NOTE: This helper stub has been added for backwards compatibility to
11+
// support downstream consumers who expect graph.h to be at the
12+
// root of the installed planarity headers directory. Future downstream
13+
// consumers are advised to include the graphLib.h helper stub instead
14+
// because it offers access to all features in the graph library of
15+
// the planarity project.
16+
1017
#ifdef __cplusplus
1118
extern "C"
1219
{
1320
#endif
1421

15-
#include "graphStructures.h"
16-
17-
#include "io/g6-read-iterator.h"
18-
#include "io/g6-write-iterator.h"
19-
#include "io/strbuf.h"
20-
#include "io/strOrFile.h"
21-
22-
#include "extensionSystem/graphExtensions.h"
23-
24-
///////////////////////////////////////////////////////////////////////////////
25-
// Definitions for higher-order operations at the vertex, edge and graph levels
26-
///////////////////////////////////////////////////////////////////////////////
27-
28-
graphP gp_New(void);
29-
30-
int gp_InitGraph(graphP theGraph, int N);
31-
void gp_ReinitializeGraph(graphP theGraph);
32-
int gp_CopyAdjacencyLists(graphP dstGraph, graphP srcGraph);
33-
int gp_CopyGraph(graphP dstGraph, graphP srcGraph);
34-
graphP gp_DupGraph(graphP theGraph);
35-
36-
int gp_CreateRandomGraph(graphP theGraph);
37-
int gp_CreateRandomGraphEx(graphP theGraph, int numEdges);
38-
39-
void gp_Free(graphP *pGraph);
40-
41-
int gp_Read(graphP theGraph, char const *FileName);
42-
int gp_ReadFromString(graphP theGraph, char *inputStr);
43-
44-
#define WRITE_ADJLIST 1
45-
#define WRITE_ADJMATRIX 2
46-
#define WRITE_DEBUGINFO 3
47-
#define WRITE_G6 4
48-
49-
int gp_Write(graphP theGraph, char const *FileName, int Mode);
50-
int gp_WriteToString(graphP theGraph, char **pOutputStr, int Mode);
51-
52-
int gp_IsNeighbor(graphP theGraph, int u, int v);
53-
int gp_GetNeighborEdgeRecord(graphP theGraph, int u, int v);
54-
int gp_GetVertexDegree(graphP theGraph, int v);
55-
int gp_GetVertexInDegree(graphP theGraph, int v);
56-
int gp_GetVertexOutDegree(graphP theGraph, int v);
57-
58-
int gp_GetArcCapacity(graphP theGraph);
59-
int gp_EnsureArcCapacity(graphP theGraph, int requiredArcCapacity);
60-
61-
int gp_AddEdge(graphP theGraph, int u, int ulink, int v, int vlink);
62-
int gp_DynamicAddEdge(graphP theGraph, int u, int ulink, int v, int vlink);
63-
int gp_InsertEdge(graphP theGraph, int u, int e_u, int e_ulink,
64-
int v, int e_v, int e_vlink);
65-
66-
void gp_HideEdge(graphP theGraph, int e);
67-
void gp_RestoreEdge(graphP theGraph, int e);
68-
int gp_HideVertex(graphP theGraph, int vertex);
69-
int gp_RestoreVertex(graphP theGraph);
70-
int gp_DeleteEdge(graphP theGraph, int e, int nextLink);
71-
72-
int gp_ContractEdge(graphP theGraph, int e);
73-
int gp_IdentifyVertices(graphP theGraph, int u, int v, int eBefore);
74-
int gp_RestoreVertices(graphP theGraph);
75-
76-
int gp_CreateDFSTree(graphP theGraph);
77-
int gp_SortVertices(graphP theGraph);
78-
int gp_LowpointAndLeastAncestor(graphP theGraph);
79-
int gp_LeastAncestor(graphP theGraph);
80-
int gp_PreprocessForEmbedding(graphP theGraph);
81-
82-
int gp_Embed(graphP theGraph, int embedFlags);
83-
int gp_TestEmbedResultIntegrity(graphP theGraph, graphP origGraph, int embedResult);
84-
85-
/* Possible Flags for gp_Embed. The planar and outerplanar settings are supported
86-
natively. The rest require extension modules. */
87-
88-
#define EMBEDFLAGS_PLANAR 1
89-
#define EMBEDFLAGS_OUTERPLANAR 2
90-
91-
#define EMBEDFLAGS_DRAWPLANAR (4 | EMBEDFLAGS_PLANAR)
92-
93-
#define EMBEDFLAGS_SEARCHFORK23 (16 | EMBEDFLAGS_OUTERPLANAR)
94-
#define EMBEDFLAGS_SEARCHFORK4 (32 | EMBEDFLAGS_OUTERPLANAR)
95-
#define EMBEDFLAGS_SEARCHFORK33 (64 | EMBEDFLAGS_PLANAR)
96-
97-
#define EMBEDFLAGS_SEARCHFORK5 (128 | EMBEDFLAGS_PLANAR)
98-
99-
#define EMBEDFLAGS_MAXIMALPLANARSUBGRAPH 256
100-
#define EMBEDFLAGS_PROJECTIVEPLANAR 512
101-
#define EMBEDFLAGS_TOROIDAL 1024
102-
103-
/* If LOGGING is defined, then write to the log, otherwise no-op
104-
By default, neither release nor DEBUG builds including LOGGING.
105-
Logging is useful for seeing details of how various algorithms
106-
handle a particular graph. */
107-
108-
// #define LOGGING
109-
#ifdef LOGGING
110-
111-
#define gp_LogLine _LogLine
112-
#define gp_Log _Log
113-
114-
void _LogLine(const char *Line);
115-
void _Log(const char *Line);
116-
117-
#define gp_MakeLogStr1 _MakeLogStr1
118-
#define gp_MakeLogStr2 _MakeLogStr2
119-
#define gp_MakeLogStr3 _MakeLogStr3
120-
#define gp_MakeLogStr4 _MakeLogStr4
121-
#define gp_MakeLogStr5 _MakeLogStr5
122-
123-
char *_MakeLogStr1(char *format, int);
124-
char *_MakeLogStr2(char *format, int, int);
125-
char *_MakeLogStr3(char *format, int, int, int);
126-
char *_MakeLogStr4(char *format, int, int, int, int);
127-
char *_MakeLogStr5(char *format, int, int, int, int, int);
128-
129-
#else
130-
#define gp_LogLine(Line)
131-
#define gp_Log(Line)
132-
#define gp_MakeLogStr1(format, one)
133-
#define gp_MakeLogStr2(format, one, two)
134-
#define gp_MakeLogStr3(format, one, two, three)
135-
#define gp_MakeLogStr4(format, one, two, three, four)
136-
#define gp_MakeLogStr5(format, one, two, three, four, five)
137-
#endif
22+
#include "c/graphLib/graph.h"
13823

13924
#ifdef __cplusplus
14025
}

planarity_src/c/graphLib.h

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,22 @@
1-
#ifndef GRAPHLIB_H
2-
#define GRAPHLIB_H
1+
#ifndef HELPERSTUB_GRAPHLIB_H
2+
#define HELPERSTUB_GRAPHLIB_H
33

44
/*
55
Copyright (c) 1997-2025, John M. Boyer
66
All rights reserved.
77
See the LICENSE.TXT file for licensing information.
88
*/
99

10+
// NOTE: This helper stub has been added to make it easier for downstream
11+
// consumers to obtain access to all features in the graph library of
12+
// the planarity project.
13+
1014
#ifdef __cplusplus
1115
extern "C"
1216
{
1317
#endif
1418

15-
#include <string.h>
16-
#include <stdlib.h>
17-
#include <time.h>
18-
#include <ctype.h>
19-
20-
#include "graph.h"
21-
22-
#include "lowLevelUtils/platformTime.h"
23-
24-
#include "homeomorphSearch/graphK23Search.h"
25-
#include "homeomorphSearch/graphK33Search.h"
26-
#include "homeomorphSearch/graphK4Search.h"
27-
#include "planarityRelated/graphDrawPlanar.h"
28-
29-
// This is the main location for the project and shared library version numbering.
30-
// Changes here must be mirrored in configure.ac
31-
//
32-
// The overall project version numbering format is major.minor.maintenance.tweak
33-
// Major is for an overhaul (e.g. many features, data structure change, change of backward compatibility)
34-
// Minor is for feature addition (e.g. a new algorithm implementation added, new interface)
35-
// Maintenance is for functional revision (e.g. bug fix to existing algorithm implementation)
36-
// Tweak is for a non-functional revision (e.g. change of build scripts or testing code, user-facing string changes)
37-
38-
#define GP_PROJECTVERSION_MAJOR 4
39-
#define GP_PROJECTVERSION_MINOR 0
40-
#define GP_PROJECTVERSION_MAINT 1
41-
#define GP_PROJECTVERSION_TWEAK 0
42-
43-
char *gp_GetProjectVersionFull(void);
44-
45-
// Any change to the project version numbers should also affect the
46-
// shared library version numbers below.
47-
//
48-
// See configure.ac for how to update these version numbers
49-
#define GP_LIBPLANARITYVERSION_CURRENT 3
50-
#define GP_LIBPLANARITYVERSION_REVISION 0
51-
#define GP_LIBPLANARITYVERSION_AGE 1
52-
53-
char *gp_GetLibPlanarityVersionFull(void);
19+
#include "c/graphLib/graphLib.h"
5420

5521
#ifdef __cplusplus
5622
}

planarity_src/c/extensionSystem/graphExtensions.c renamed to planarity_src/c/graphLib/extensionSystem/graphExtensions.c

File renamed without changes.

planarity_src/c/extensionSystem/graphExtensions.h renamed to planarity_src/c/graphLib/extensionSystem/graphExtensions.h

File renamed without changes.

planarity_src/c/extensionSystem/graphExtensions.private.h renamed to planarity_src/c/graphLib/extensionSystem/graphExtensions.private.h

File renamed without changes.

planarity_src/c/extensionSystem/graphFunctionTable.h renamed to planarity_src/c/graphLib/extensionSystem/graphFunctionTable.h

File renamed without changes.

0 commit comments

Comments
 (0)