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

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:
pigale -server (serves one client at a time)
then the client:
client < data
or a pipe
cat data | client (under Windows: type data | client).
If the Client does not run on the same machine as the server:
client www.computer.com < data

An example file Clientdata.txt and three graphs are provided. If you run
./client < Clientdata.txt
you should receive 8 png files and a graphml file containing the last graph created.

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 get a png image 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
OPT 3-Connected
MIN_D minimal degree
MAX_D maximal degree
COORD retrieve coords
VLAB retrieve labels (long integers)
Generators settings
GEN_N1 number of vertices an integer
GEN_N2 number of vertices an integer
GEN_M number of edges an integer

All the other commands are the standart Pigale macros.

Generators
GEN_GRID grid GEN_N1, GEN_N2
GEN_COMPLETE complete graph GEN_N1
GEN_COMPLETE_BIP complete bipartite graph GEN_N1, GEN_N2
GEN_RANDOM planar or not GEN_N1 GEN_M
GEN_PLANAR planar GEN_M
GEN_PLANAR_2C planar 2-connected GEN_M
GEN_PLANAR_3C planar 3-connected GEN_M
GEN_PLANAR_3R_2C planar 3-regular 2-connected GEN_M
GEN_PLANAR_3R_3C planar 3-regular 3-connected GEN_M
GEN_PLANAR_3R_D4C planar 3-regular 3-connected without 4-separator GEN_M
GEN_PLANAR_4R_C planar 4-regular connected GEN_M
GEN_PLANAR_4R_2C planar 4-regular 2-connected GEN_M
GEN_PLANAR_4R_3C planar 4-regular 3-connected GEN_M
GEN_PLANAR_4R_BIP planar 4-regular bipartite GEN_M
GEN_PLANAR_BIP planar bipartite GEN_M
GEN_PLANAR_BIP_2C planar 2-connected bipartite GEN_M
GEN_PLANAR_BIP_3C planar 3-connected bipartite GEN_M
GEN_P_OUTER_N maximal outerplanar GEN_N1
GEN_P_OUTER_NM outerplanar GEN_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_E Schnyder algorithm: the graph is first made maximal by adding edges
SCHNYDER_V Schnyder algorithm: the graph is first made maximal by adding vertices
FPP_FARY Fraysseix, Pach, Pollack algorithm
POLYLINE Bonichon's algorithm (3-connected planar graph)
CCD Convex drawing (3-connected planar graph)
CD Optimal 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)
CURVES spring embedder using curves
VISION visibility algorithm for planar graphs
CONTATC_BIPARTI representation of planar bipartite graphs by contact of segments
FPP_RECTI kind 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
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_CRITICAL extract a cotree critical subgraph of a non-planar graph
COLOR_NON_CRITIC color non-critical cotree edges of a non-planar graph
NPSET
FIND_MAX_PLANAR heuristic to find a maximal planar subgraph in a non-planar graph
NETCUT partition a graph in a prescribe number of classes
SYMETRIE heuristic 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

# debug mode
:D
# ask to transfer the file sym.graphml from the client
RC_GRAPH;../tgf/sym.graphml
# ask the general visibility drawing
GVISION
# asks to create and transfer to the client a png file
PNG
EMBED-3d:PNG
:!

Output

Below is a screen-shot of the client running the previous file.
client

Last modified: Tue Jan 29 12:01:58 CET 2008

Valid XHTML 1.0 Strict