[jgrapht-users] Bounded out-degree digraphs
Brought to you by:
barak_naveh,
perfecthash
From: Jonathan M. <jon...@it...> - 2008-03-11 13:57:18
|
I'd like to use the JGraphT library as a basis for a prototype in my research on pointer analysis for linked data structures, but I'd like to tailor the implementation to fit my needs. Specifically, I'd like to deal with digraphs that have at most k successors, and I'd like to distinguish between successor 0, 1, 2 and so forth. Even more specifically, I'd like to have a method getSuccessor(V vertex, int i) that returns the i:th successor of vertex. I tried to prod about in the AbstractBaseGraph, but I got lost in the DirectedEdgeContainer. As I understand it, there is the place to extend to achieve my goal, but incoming and outgoing are Sets, so how do I do this the best way? Or is the way to go the extremely ugly one, namely using DirectedWeightedGraph and just mine the outGoingEdges for the edge with the correct weight (letting the weights symbolise the number of the successor). It seems like such a sad abuse of an otherwise extrordinary framework... Regards Jonathan |