Re: [jgrapht-users] Null Edge
Brought to you by:
barak_naveh,
perfecthash
From: Mohammad I. <msi...@ua...> - 2011-07-06 16:15:33
|
Hello, I have found the error. Actually I used similar codes earlier and it gave correct result so I thought that it may be some problem of libraries. I figured out that I have included JGraph library which was not there before and NetBeans imported DefaulEdge from JGraph not JGraphT and that was causing the problem. Thanks. On Wed, Jul 6, 2011 at 2:06 AM, Ismail Marmoush <mar...@gm...>wrote: > Slam Alekom Mohamed, > > It compiles and runs fine in my machine > The output is like this: > ([v1, v2, v3, v4], [{v1,v2}, {v2,v3}, {v3,v4}, {v4,v1}]) > > I guess it's something not related to the code it self but to > (configurations , IDE , compilation etc.. ) > > On Wed, Jul 6, 2011 at 5:18 AM, Mohammad Islam <msi...@ua...>wrote: > >> Hello, >> >> Here is the code. It is copied from the HelloJGraphT program. >> >> UndirectedGraph<String, DefaultEdge> g = >> new SimpleGraph<String, DefaultEdge>(DefaultEdge.class); >> >> String v1 = "v1"; >> String v2 = "v2"; >> String v3 = "v3"; >> String v4 = "v4"; >> >> // add the vertices >> g.addVertex(v1); >> g.addVertex(v2); >> g.addVertex(v3); >> g.addVertex(v4); >> >> // add edges to create a circuit >> g.addEdge(v1, v2); >> g.addEdge(v2, v3); >> g.addEdge(v3, v4); >> g.addEdge(v4, v1); >> >> System.out.println(g.toString()); >> >> >> On Tue, Jul 5, 2011 at 5:13 PM, Ismail Marmoush <mar...@gm... >> > wrote: >> >>> try to provide some code please >>> >>> On Tue, Jul 5, 2011 at 7:28 PM, Mohammad Islam <msi...@ua...>wrote: >>> >>>> Hello, >>>> >>>> I am a new member of this list and a new user of JGrapht. I was trying >>>> to build a graph using the provided HelloJGraphT program. The program runs >>>> well but when I was trying to print the Graph using toString I found that >>>> all the edges are null. Here is the output >>>> >>>> ([v1, v2, v3, v4], [null={v1,v2}, null={v2,v3}, null={v3,v4}, >>>> null={v4,v1}]) >>>> >>>> Even when I tried to get the set of edges and try to print the >>>> edges separately I got null edges. So what may be the problem. >>>> >>>> -- >>>> Mohammad Saiful Islam >>>> MSc(Thesis) >>>> Dept of Computing Science >>>> University of Alberta >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> All of the data generated in your IT infrastructure is seriously >>>> valuable. >>>> Why? It contains a definitive record of application performance, >>>> security >>>> threats, fraudulent activity, and more. Splunk takes this data and makes >>>> sense of it. IT sense. And common sense. >>>> http://p.sf.net/sfu/splunk-d2d-c2 >>>> _______________________________________________ >>>> jgrapht-users mailing list >>>> jgr...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jgrapht-users >>>> >>>> >>> >> >> >> -- >> Mohammad Saiful Islam >> MSc(Thesis) >> Dept of Computing Science >> University of Alberta >> >> > -- Mohammad Saiful Islam MSc(Thesis) Dept of Computing Science University of Alberta |