commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claudio Squarcella <>
Subject Re: [Graph] Weighted as an interface
Date Tue, 06 Dec 2011 09:11:29 GMT

>>> Moreover, I start having the feeling the {{WeightedGraph}} is a
>>> useless interface: it is enough marking the vertices/edges as weighted
>>> depending on the problem... or not? At the end of the day,
>>> {{WeightedGraph}} does nothing than having the the edges marked as
>>> weighted, so Dijkstra signature changed as:
>>> <V extends Vertex, WE extends WeightedEdge, G extends DirectedGraph<V,
>>> WE>>    WeightedPath<V, WE>    findShortestPath( G graph,  V source,
>>> target )
>>> still define well the input type, a graph wich relations are directed
>>> edges and edges are weighted... WDYT?
>> I agree, as long as there are no specific features of the graph that are
>> independent on its vertices and edges.

quoting myself here: actually I think {{WeightedGraph}} should *not* go 
away if it makes sense to add methods to it later (e.g. to get the total 
weight). But changing the signature of the methods is still a valid 
idea, as it allows for a more fine-grained expressiveness on the input. 


>> Another advantage: I won't bother
>> later to add more speficic interfaces like {{EdgeWeightedGraph}} or
>> {{VertexWeightedGraph}} ;-)
> +1, please include that in a separate issue!
> All the best, have a nice day!
> Simo
>> Ciao,
>> Claudio
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Claudio Squarcella
PhD student at Roma Tre University
E-mail address:
Phone: +39-06-57333215
Fax: +39-06-57333612

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message