Quantcast

Problem with ListenableDirectedGraph with custom edge class

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem with ListenableDirectedGraph with custom edge class

Andreea Sandu
Hi,

I have a problem when using a ListenableDirectedGraph with a custom edge, as shown below:

ListenableDirectedGraph<CypherBasicNode, CypherBasicEdge> dirGraph = 
new ListenableDirectedGraph<CypherBasicNode, CypherBasicEdge>(CypherBasicEdge.class);

Everything is displayed fine in the Applet, but when I issue a dirGraph.edgeSet() the set is not correct. The first value in the set it is correct, while all the rest are null. I was researching and saw that when an addEdge is made, the empty constructor of the custom edge class is called (which I don't understand why, because I create the edge beforehand and I add it using:

CypherBasicEdge edge = new CypherBasicEdge(relId);
dirGraph.addEdge(firstNode, secondNode, edge);

 ). If I delete the empty constructor I get a "java.lang.RuntimeException: Edge factory failed" exception, because in add newInstance() is called (which is weird considering that an edge Object is given as an argument to addEdge ). 
 
If I run this code:

CypherBasicEdge edge = new CypherBasicEdge(relId);
dirGraph.addEdge(firstNode, secondNode, edge);
System.out.println("first edge: " + edge);
System.out.println("second edge: " + dirGraph.getEdge(firstNode, secondNode));

I get the following output:

first edge: r2 {}
second edge: null {}
 
Which to me seems very unlikely to be correct. Meanwhile, the visual representation is correct. Also, if I change the graph from ListenableDirectedGraph to DefaultDirectedGraph, everything works correctly. 

I am not sure whether I have not understood how I should use the classes or there is some kind of bug. I would appreciated any help.

Best regards,
Andreea Sandu
 

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
jgrapht-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgrapht-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Grph: high performance graph library

Luc Hogie-2
Dear (J)graph(T) community,

I'm happy to tell you about the availability of a Java graph library targeted to performance.

I was a bit reluctant to advertise it here but Grph is by no means a competitor to JGraphT, in particular
because it's data model is not object-oriented. It is especially well suited to many scientific, data-analysis applications.

It implements numerous strategies to achieve great performance, and current works are to make it a
distributed graph computation framework, in the same veine as PBGL (Parallel Boost)

Grph is being developed and maintained at a Nice-Sophia Antipolis University (France).
It already gathers many users. We'd be very happy if it could help you.

Wish you a good day,
Luc.

--
Luc Hogie
COMRED Research Unit (I3S(CNRS-UNS) INRIA)
I3S Laboratory, University of Nice Sophia Antipolis

http://www-sop.inria.fr/members/Luc.Hogie/
[hidden email]
+33 4 89 73 24 25 (office)
+33 6 80 91 40 71 (mobile)



------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
jgrapht-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgrapht-users
Loading...