logo P.I.G.A.L.E.

Public Implementation of a Graph Algorithm
Library and Editor


H. de Fraysseix      P. Ossona de Mendez
SourceForge Logo

HOME

Client Server

The simple program client is an example how to communicate with the server. The client reads its instructions from stdin so that it should not be difficult for applications to communicate with the server.

The server and client use a TCP connection on port 4242. The server should be allowed to write on /tmp or \tmp on Windows (CREATE it, if necessary).

To launch the client/server application,
First launch the server: then the client:
The example file Clientdata.txt produces 14 png files.

Main Commands

The commands that can be used are most of the ones found in QT/Action.h, that is all the Pigale macros plus some specific ones:

Specific commands
Command Argument
RS_GRAPH graph filename load a graph (on the server side)
RC_GRAPH graph filename load a graph (from the client side)
N_GRAPH creates an empty graph
N_V number of vertices create n vertices

N_E
pair of vertices create an edge
PNG size (1 int) get a png image of the current drawing
PS get a postscript file of the current drawing
RS_SAVE_GRAPH graph filename with extension ask the server to save the current graph and send it to the client (the file format is determined by the extension)

Informations
N number of vertices
M number of edges
SIMPLE simple graph
PLAN planar
OPLAN outer planar
SR serie-parallel
MPLAN triangulated planar graph
BI bipartite graph
MBI max planar bipartite graph
REG regular
C1 connected
C2 2-Connected
C3 3-Connected
MIN_D minimal degree
MAX_D maximal degree
COORD retrieve coords
VLAB retrieve labels (long integers)
Generators settings
GEN_N1 number of verticesan integer
GEN_N2 number of verticesan integer
GEN_M number of edgesan integer

All the other commands are the standart Pigale macros.

Generators
GEN_GRID gridGEN_N1, GEN_N2
GEN_COMPLETE complete graphGEN_N1
GEN_COMPLETE_BIP complete bipartite graphGEN_N1, GEN_N2
GEN_RANDOM planar or notGEN_N1 GEN_M
GEN_PLANAR planarGEN_M
GEN_PLANAR_2C planar 2-connectedGEN_M
GEN_PLANAR_3C planar 3-connectedGEN_M
GEN_PLANAR_3R_2C planar 3-regular 2-connectedGEN_M
GEN_PLANAR_3R_3C planar 3-regular 3-connectedGEN_M
GEN_PLANAR_3R_D4C planar 3-regular 3-connected without 4-separatorGEN_M
GEN_PLANAR_4R_C planar 4-regular connectedGEN_M
GEN_PLANAR_4R_2C planar 4-regular 2-connectedGEN_M
GEN_PLANAR_4R_3C planar 4-regular 3-connectedGEN_M
GEN_PLANAR_4R_BIP planar 4-regular bipartiteGEN_M
GEN_PLANAR_BIP planar bipartiteGEN_M
GEN_PLANAR_BIP_2C planar 2-connected bipartiteGEN_M
GEN_PLANAR_BIP_3C planar 3-connected bipartiteGEN_M
GEN_P_OUTER_N maximal outerplanarGEN_N1
GEN_P_OUTER_NM outerplanarGEN_N1, GEN_M

Duality and Angle graphs
DUAL
DUAL_G without the exterior vertex
ANGLE
ANGLE_G without the exterior face

Augmentation algorithms
CONNECT add edges
CONNECT_V add vertices
BICONNECT biconnect a planar graph adding edges
BICONNECT_NP biconnect adding edges
BICONNECT_NP_V biconnect adding vertices
TRIANGULATE_ZZ triangulate adding edges
TRIANGULATE_V triangulate adding vertices
TRIANGULATE_3C triangulate a 3-connected planar graph adding edges
QUADRANGULATE_V quadrangle a bipartite graph, adding vertices
BISSECT_ALL_E bisect all edges

Remove operations
REMOVE_ISOLATED_V
REMOVE_LOOPS
REMOVE_MULTIPLE_E
REMOVE_BRIDGES

Drawings
SCHNYDER_ESchnyder algorithm: the graph is first made maximal by adding edges
SCHNYDER_VSchnyder algorithm: the graph is first made maximal by adding vertices
FPP_FARYFraysseix, Pach, Pollack algorithm
POLYLINEBonichon's algorithm (3-connected planar graph)
CCDConvex drawing (3-connected planar graph)
CDOptimal convex drawing by Bonichon
TUTTE_CIRCLE some edges are added before using Tutte's barycentric representation
TUTTE Tutte's barycentric representation
SPRING_PM spring embedder preserving the map
JACQUARD spring embedder for planar graphs (Jacquard)
CURVESspring embedder using curves
VISION visibility algorithm for planar graphs
CONTATC_BIPARTI representation of planar bipartite graphs by contact of segments
FPP_RECTIkind of visibility representation based on FPP_FARY
GVISION visibility algorithm generalized to non-planar graphs
T_CONTACT representation of a planar graph by contact of T
TRIANGLE_CONTACT representation of a planar graph by contact of triangles
EMBED-3d 3d representations
EMBED-3d_SCHNYDER representation on S2 of a planar graph

Algorithms
KURATOWSKI extract a Kuratowski subdivision of a non-planar graph
COTREE_CRITICALextract a cotree critical subgraph of a non-planar graph
COLOR_NON_CRITICcolor non-critical cotree edges of a non-planar graph
NPSET
FIND_MAX_PLANARheuristic to find a maximal planar subgraph in a non-planar graph
NETCUT partition a graph in a prescribe number of classes
SYMMETRYheuristic to detect a symetrie in a graph
USE_GEOMETRIC_CIR
USE_LRALGO_CIR
COLOR_BIPARTI
COLOR_EXT_FACE
RESET_COLORS

Orientation algorithms
ORIENT_EDGES
ORIENT_INF
ORIENT_TRICON
ORIENT_BIPARTITE
ORIENT_SCHNYDER
ORIENT_BIPOLAR
ORIENT_BIPOLAR_NON_PLANAR

User defined algorithms
TEST_1
TEST_2
TEST_3

A few words about the syntax

Command are separated by : and arguments by ;.
For example, the line
RC_GRAPH;ex.graphml
asks to transfer the file ex.graphml from the client and read the graph.

Lines starting with # or ; have a special meaning:
- lines starting with '#' are comments
- lines starting with ':' modifies the client-server behavior:

Whether under Linux or Windows, use / and not \ inside path names.

In debugging mode all the commands (including comments) are echoed by the client and then by the server (prepended by a !) when the command has been fully processed.

An example

Input


:D
#generate a 4-regular 3-connected graph
GEN_M;30
GEN_PLANAR_4R_3C
POLYLINE
PNG
SCHNYDER_E
PNG
SPRING_PM
PNG
TUTTE_CIRCLE
CURVES
PNG
TRIANGLE_CONTACT
PNG
PNG
RC_GRAPH;../tgf/sym.graphml
EMBED-3d
PNG
#create a graph
N_GRAPH
#create 5 vertices
N_V;6
#add edges
N_E;1;2
N_E;1;3
N_E;1;4
N_E;1;5
N_E;2;3
N_E;2;4
N_E;2;5
N_E;3;4
N_E;3;5
N_E;4;5
N_E;5;6
N_E;4;6
N_E;3;6
N_E;3;6
GVISION
PNG
#generate a 4-regular 3-connected graph
GEN_M;30
GEN_PLANAR_4R_3C
CCD
PNG
#generate a 3-connected bipartite graph
GEN_PLANAR_BIP_3C
CONTACT_BIPARTI
PNG
2_PAGES_BIPARTI
PNG
POLAR
PNG
FPP_RECTI
PNG
POLREC_BFS
PNG
# close
:X

Output

client client client client client client client client client client client client client client

Last modified: 23/02/2020