Edge: variable weight

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

Edge: variable weight

Alessandro-2
Hi jgraphtrs,


I use the dijkstra alghoritm (in
org._3pq.jgrapht.alg.DijkstraShortestPath).. it use getWeight() method
in edge (DirectedEdge).
Well! I wish a variable weight for each edge (depend on a parameter;
this parameter is present in the object which call DijkstraShortestPath
method).

Some suggestion?

Thank you very much!
Bye bye,
        Alessandro




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Edge: variable weight

Kyle Lahnakoski
Your second sentence was unclear, so I will ignore it, dispite it
sounding important.

I assume you have a set of objects (or equivalent) that can provide the
required weights.

You can have those objects implement the Edge interface, and then use
them in your graph instead of the DirectedWeightedEdge.

Alternativly, you could make one DirectedWeightedEdge for each object,
using the object  weights in the constructor.


Good luck



Alessandro wrote:

> Hi jgraphtrs,
>
>
> I use the dijkstra alghoritm (in
> org._3pq.jgrapht.alg.DijkstraShortestPath).. it use getWeight() method
> in edge (DirectedEdge).
> Well! I wish a variable weight for each edge (depend on a parameter;
> this parameter is present in the object which call
> DijkstraShortestPath method).
>
> Some suggestion?
>
> Thank you very much!
> Bye bye,
>     Alessandro
>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> jgrapht-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jgrapht-users
>


--
----------------------------------------------------------------------
Kyle Lahnakoski                                       [hidden email]
(416) 892-7784                                    Arcavia Software Ltd



Loading...