You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Simone Tripodi (Resolved) (JIRA)" <ji...@apache.org> on 2011/12/18 20:58:31 UTC
[jira] [Resolved] (SANDBOX-345) Weighted as an interface with
generic weight type
[ https://issues.apache.org/jira/browse/SANDBOX-345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Simone Tripodi resolved SANDBOX-345.
------------------------------------
Resolution: Fixed
Assignee: Simone Tripodi
Simply amazing Claudio, thanks for the hard work!
I just applied your patch, see [r1220522|http://svn.apache.org/viewvc?view=revision&revision=1220522]
I just have modified a part in the DotExporter to avoid multiple checks - the rest looks more than OK ;)
Thanks for contributing!
> Weighted as an interface with generic weight type
> -------------------------------------------------
>
> Key: SANDBOX-345
> URL: https://issues.apache.org/jira/browse/SANDBOX-345
> Project: Commons Sandbox
> Issue Type: Improvement
> Components: Graph
> Reporter: Claudio Squarcella
> Assignee: Simone Tripodi
> Priority: Minor
> Labels: graph, weight, weighted
> Attachments: WeightedAsAnInterfaceWithGenericWeightType.patch
>
>
> Hello,
> after recent discussions on the mailing list ("[Graph] On graph weight type(s)") I am proposing a first patch to enable support for generic weights in the current implementation.
> Main changes include:
> - adding an interface Weighted<W> with method W getWeight()
> - modifying WeightedEdge, WeightedPath, WeightedGraph etc. to implement the new interface
> - changing the implemented algorithms (at the moment they all still require weights to be Double)
> - changing the DOT exporter (prints the weight as an attribute only if it is of type Double)
> - incidentally also fixing a small bug in the DOT exporter ('weight' was part of the label, now it is a proper attribute as documented in DOT language specs http://www.graphviz.org/content/attrs#dweight)
> This can be the first safe step to dig into different types and/or properties of weights.
> Please let me know if it looks good.
> Cheers,
> Claudio
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira