Re: [jgrapht-users] AsWeightedGraph implementation with unit test
Brought to you by:
barak_naveh,
perfecthash
From: John V. S. <js...@gm...> - 2007-09-23 06:47:26
|
I have committed this and the AsUnweighted implementations to Subversion. I suppose an AsWeightedDirectedGraph version will also be needed and can share most of the implementation with AsWeightedGraph. JVS Lucas Scharenbroich wrote: > Here is an implementation of the AsWeightedGraph class as described on > the Wiki. There may be room for some debate on the semantics of the > class. I have implemented it such that calls to setEdgeWeight pass > through to the backing graph if it implements the WeightedGraph > interface. Call to setEdgeWeight will always update the passed edge > weight map in order to make the graph consistent with the sequence of > operations performed on it. > > It may be better to copy the passed weight map in the constructor rather > than just keeping a reference to it. > > Also, calls to getEdgeWeight will pass through to the backing graph only > is the specified edge does no exist in the weight map. > > -Lucas |