[jgrapht-developers] edge ownership
Brought to you by:
barak_naveh,
perfecthash
From: John V. S. <js...@ya...> - 2003-10-07 01:18:44
|
Graph.java has the following comment: "This library works best when vertices represent arbitrary objects and edgesrepresent the relationships between them. While vertex instances are expected to be included in more than one graph, edges are generally assumed to be exclusive to one graph. The method <code>addEdge(Edge)</code> provides a back-door for that assumption and a programmer must exercise care if decided to use it." What is the reason for the edge ownership exclusivity? Allowing edges to be aliased in more than one graph is generally useful (especially if they have some additional information associated with them). And view graphs like SubGraph and AsUndirectedGraph implicitly violate the ownership rule. Anyway, it seems like it should be a hard rule one way or the other, not just a "general assumption." JVS |