allow duplicate vertex in with jgrapht

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

allow duplicate vertex in with jgrapht

laassem

hi, 
i want to represent xml file with jgrapht , this xml file contain a duplicate name of nods , how can i allow this ? 
attached exemple of a graph that i want to use with jgrapht ?
--
LAASSEM BRAHIM
Centre des études doctorales Ibn Zohr
Laboratoire IRF – SIC
Département informatique
faculté des sciences
Univrsité IBN ZOHR
Agadir.


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
jgrapht-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgrapht-users

graphe document.jpeg (46K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: allow duplicate vertex in with jgrapht

claus
A vertex can only exist once. You need to tag it with a unique  ID, if you have duplicate names. Java impl of jGraphT internally uses HasSets/Maps, therefore you can overcome the problem if you use your own vertex implementation (vertex factory) and override hashCode() / equals().
Loading...