GraphStream Users

Archives de la liste Aide


回复:Create graph with multiple li nks between two nodes from dot file


Chronologique Discussions 
  • From: "295168281 AT qq.com" <295168281 AT qq.com>
  • To: Sumner <mag.ds AT live.com>, "graphstream-users AT litislab.fr" <graphstream-users AT litislab.fr>, Chris Saltmarsh <indy.maturin AT gmail.com>
  • Subject: 回复:Create graph with multiple li nks between two nodes from dot file
  • Date: Thu, 24 Feb 2022 09:02:18 +0800
  • Authentication-results: a-mx1.relay.syrhano.net; spf=Pass smtp.mailfrom=295168281 AT qq.com; spf=None smtp.helo=postmaster AT out203-205-251-36.mail.qq.com
  • Ironport-data: A9a23:kmmxWqi6CVFSNiVoRLfPG3wVX161PxEKZh0uj C45NGQN5FlHY01jehtvXziOP6mLNDGgeNwjOoripE4PuMLSndcxSQpk/y01E HsW8JqUDtmwEBz9bniYRiHhoO2LzCm/huEtm6nYd1eEzvuWGuWn/SkUOZ2gH OKmUraeYHspHmeIdQ944f5ds79h6mJXqYLka++9kYuaT/z3YDdJ6RYtWo4nw /jrRCdUgRjHkGhwUmrSyhx8lAS2e3E9VPrzLEwqRpfyatE88uWSH44vwFwll 1418SvBCvv9+lr6WkoXXuSKZk3U0icTAfX7x0Mc4Ck706J9LeNaYkBS49mLt 4opk5MX7cH2E1pwePaS8Agee0Ew/yVWZ/wboeGXeyjmmdWKiUbBdhMAxt0yU xpobNVJpI6bBkkVrKJHdWlRBvyZvMq52rujSvJwnMkqKYz2J44FoVlkzC3YF vIvS9bNWc33CXVwyG9l3YYTCa+LP4xBfWA6NFKbP0YQLgxCUNRjiLj9r2fbW Dh+g06ziaoTwmH19gxV6qPLCsTzRsSsed9zih/A8zqCp3CR7goyM8GDk2Let yj026qVwHq+A9xUEbS58rhzmRuYwWl7NfHfbnPjydHRt6J0c4s3x40oFisSQ Wwa81G3FIGmGkfg/Tve40dZAIQWFuQ77EeU0+zf5APx6q3oiNJeQIROiSP0b WRCOpy1cxfBHCUpu7qQIZ5Y3qnBtiu8YED5MkdbDRI5odM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jd FJWAi7BpL36jPq5oAX4WOkY1KRu1PSA9syBY5xc/PPxAhcJgNtzrUzjUXH8i o5exCNXawgYHXDPx4nxZwOTcLaiUK/52gj31m4xl7ecY/XgGsmfcCGFyuu4O +sgrRcGmE1pkJga7pZQQNntOdrVXUn8/JzRSxopakquzuLuGZNmx5keUGSIR KmULPGat1jA/e8pL+SWAe1d8D/gN/go4eLvhn4liBcce6eux54edHG/GLxvP UyYZXPmhtpJH30Nu0IyS+njiVvKVjA2BT76R6Un+jQyE56rF6/EW5z32OfEh n/mW8cLPyUdVBaJGHbsMZydHfwLbWPaI8NslCAFSan0S4Il0kLL1keywL5mI +zIvywA4Mi7j54vv7CVz0xrs2cqXIyH3mqATn95hDYBAjomheZlrEh02xGYw LJ4ivpfU9pe+6AsME9yOJjCwuh9E923VBjGe4LDEgf7G4v2W2FoZssohdQJZ gwufrfqxgCGxCesD7IPwvaTA4co96vHw3XrD8Fg1yyej+x71wRjGJYWcDb4w Kt29gyVHpePmEKc3fXPF+xUzGvG82GNynCLtUdTXVtrSavyWnYbdyM+TPz++ 1+YF+TrU+x6d1EckIvZdO1PY9zty0xfAvzkPYaGC4pes36pQx2Pw+HVBLc =
  • Ironport-sdr: BMIoeSprND0QvUe0ca5PZDCY82pOL01ReDZUZd+6fpkhgYO8kXmQO/gwb3y9F99dwz8xUbQX+4 6YLLIMmvaNEw==

remove me from the mail list please

发自我的华为手机


-------- 原始邮件 --------
发件人: Sumner <mag.ds AT live.com>
日期: 2022年2月24日周四 凌晨1:20
收件人: graphstream-users AT litislab.fr, Chris Saltmarsh <indy.maturin AT gmail.com>
主 题: Re: Create graph with multiple links between two nodes from dot file
How can I get off this mailing list?

On Feb 23, 2022, at 12:05 PM, Chris Saltmarsh <indy.maturin@gmail.com> wrote:

I had a similar thing - translating from a sort of xml which describes PetriNet graphs and thence to a more compressed json equivalent.

<xmlIsNotReallyForHumanBeingsAsItsTooVerbose>true</xmlIsNotReallyForHumanBeingsAsItsTooVerbose>
I did the json parser in java, anyway, so went direct to GraphStream rather than through DGS. Works a treat.

Chris Saltmarsh


On Wed, 23 Feb 2022 at 11:35, Yoann Pigné <yoann.pigne@gmail.com> wrote:
Hi, 

Short answer : the DOT reader in GraphStream kind of only supports single graphs. 

There is no simple solution to the problem other than a rework of the DOT parser in GS. 

Can I suggest you use a file format where GS can safely handle multigraphs like the DGS :

*********
DGS004
example 2 2
an a
an b 
ae e1 a > b
ae e2 a > b 
*********


Sincerely,

Yoann 

Le 23 févr. 2022 à 09:23, LAVELLE Sylvain <sylvain.lavelle@akka.eu> a écrit :

Hello graphstream users,
 
I have a question for the community. Here is my issue:
 
I need to create a directed graph object from a dot file. This works, but when there are two edges from one node to the same node, only one edge is created in the graph.
I am not sure if I am using the graphstream library correctly, or if the dot file is incorrect.
 
Graphstream version: 2.0
gs-core-2.0.jar
 
 
Here is an example of dot file:
*************
digraph G {
1->2;
1->2;
}
***********
From what I read of dot specification, this is valid (and some visualization tools like graphviz will draw two nodes with to edges from 1 to 2)
 
To create the graph, I use the following java code:
import org.graphstream.graph.Edge;
import org.graphstream.graph.implementations.MultiGraph;
import org.graphstream.stream.file.FileSource;
import org.graphstream.stream.file.FileSourceFactory;
/* ….  */
MultiGraph g = new MultiGraph("g",false, true); // graph id, strictChecking, autoCreate
FileSource fs = FileSourceFactory.sourceFor(filePath);
fs.addSink(g);

try {
    fs.readAll(filePath);
} catch( IOException e) {
    e.printStackTrace();
} finally {
    fs.removeSink(g);
}
//check how many connections:
System.out.println("number of edges: "+g.edges().count());
// print out: number of edges: 1
****************************
There is nothing special in the code, it is almost what is shown in the tutorial (https://graphstream-project.org/doc/Tutorials/Reading-files-using-FileSource/)
 
Can someone tell me what I should modify? Is it the graph creation? Using another type of graph or other parameters?
Should I modify the dot file?
 
Have a nice day,
Sylvain LAVELLE
Engineer


<image001.png>
7, boulevard Henri Ziegler — 31700 Blagnac — France
sylvain.lavelle@akka.eu
www.akka-technologies.com





Archives gérées par MHonArc 2.6.16.

Top of page