Article View: comp.lang.c++.leda
Article #135Re: (no subject)
From: Olivier L'Heureux
Date: Sat, 14 Oct 1995 20:50
Date: Sat, 14 Oct 1995 20:50
74 lines
2733 bytes
2733 bytes
In article <44ne7b$52v@sundog.tiac.net> Sid <mebaga@unix1.sncc.lsu.edu> writes:
[...]
>> I want to be able to use the very powerful graph planarity testing
>> program planar.c. But, I want to be able to read the graph from a
>> file. I could not find any information about how to define the
>> datafile. I will be using it on undirected and unweighted graphs.
>> For example: K3(Complete graph on 3 vertices)
The simplest way: use `ged', the Graph EDitor which comes with LEDA,
to draw your graphs. If you want to define them otherwise, look at the
result of ged.
I did it for long with version 3.1.1 of LEDA.
The format is the following:
1) A first line with the words "LEDA.GRAPH"
2) 2nd line with the name of the type for the nodes, for instance
"point" in the graphs edited with `ged'.
3) 3rd line with the name of the type for the edges, for instance
"int" in the graphs edited with `ged'.
4) 4th line with the number `n' of nodes
5) `n' lines, each with the representation of a node.
6) A line with the number `e' of edges
7) `e' lines with the rank of the source node in the list cited in 5),
a space, the rank of the sink, a space, and the representation of
the edge.
It is certainly clearer with a small example:
Suppose the following graph is a GRAPH<FirstName,int>
(Amandine)
/ | \
2 / | \7
| | |
V |8 V
(Bernard) | (Christine)
| | |
3 \ | /4
V V V
(Elise)
should give:
---------------
LEDA.GRAPH
FirstName
int
4
Amandine
Bernard
Christine
Elise
5
1 2 2
1 3 7
1 4 8
2 4 3
3 4 4
---------------
[...]
>> Sid Bagali
Olivier L'Heureux
----------------------------------------------------------------------
Laboratoire de microélectronique de l'Université catholique de Louvain
e-mail: lheureux@dice.ucl.ac.be B-1348 Louvain-la-Neuve
<URL:http://www.dice.ucl.ac.be/~lheureux> Belgium
MIME/PGP accepted
Technical Details
Message-ID:
<LHEUREUX.95Oct14215022@bartok.dice.ucl.ac.be>Path:
arc1-ca.pugleaf.net!news.sri.ucl.ac.be!lheureuxReferences:
<44ne7b$52v@sundog.tiac.net>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.sri.ucl.ac.be!lheureux From: Olivier L'Heureux <lheureux@dice.ucl.ac.be> Newsgroups: comp.lang.c++.leda Subject: Re: (no subject) Date: 14 Oct 1995 20:50:22 GMT Organization: Lab. de Microelectronique - UCL - Belgium Distribution: world Message-ID: <LHEUREUX.95Oct14215022@bartok.dice.ucl.ac.be> References: <44ne7b$52v@sundog.tiac.net> NNTP-Posting-Host: bartok.dice.ucl.ac.be Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit In-reply-to: Sid's message of 2 Oct 1995 01:11:06 GMT