commons-dev mailing list archives

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

>>> 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,
V
>>> 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. 
Right?

Claudio


>> 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
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

-- 
Claudio Squarcella
PhD student at Roma Tre University
E-mail address: squarcel@dia.uniroma3.it
Phone: +39-06-57333215
Fax: +39-06-57333612
http://www.dia.uniroma3.it/~squarcel


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message