Graph-Dijkstra
view release on metacpan or search on metacpan
lib/Graph/Dijkstra.pm view on Meta::CPAN
=item $graph->outputGraphtoJSON( $filename, {edgeWeightKey='value'} );
Using the internal graph, outputs a file following the JSON graph specification. In the Graph metadata section, includes a comment attribute referencing this
module and the local time that the JSON document was created. Uses the edgeWeightKey value (which defaults to "value") to output edge weights in the edge metadata section. See the inputGraphfromJSON method for format details.
=item $graph->outputGraphtoCSV( $filename );
Using the internal graph, outputs a file in CSV format. See the inputGraphfromCSV method for format details.
=item $graph->outputGraphtoGraphML($filename, {keyEdgeWeightID => '',keyEdgeWeightAttrName => '', keyNodeLabelID => '', keyNodeLabelID => ''} );
Using the internal graph, outputs a file in XML format following the GraphML specification (schema).
The option attributes keyEdgeWeightID and keyEdgeWeightAttrName both default to 'weight'. keyNodeLabelID and keyNodeLabelID both default to 'name'. Set these
attributes values only if you need to output different values for these key attributes.
=item $graph->outputGraphtoGEXF( $filename );
Using the internal graph, outputs a file in XML format following the GEXF draft 1.2 specification (schema).
=item $graph->outputGraphtoNET( $filename );
Using the internal graph, outputs a file in NET (Pajek) format. For node IDs, the NET format uses consecutive (sequential) numeric (integer) values (1 .. # of nodes).
If the internal graph uses sequential numeric IDs, these will be preserved in the output file. Otherwise, the existing node IDs are mapped to
sequentially numbered IDs that are output. This preserves the graph node and edge structure but necessarily looses the existing node ID values.
Undirected edges are output in the C<< *Edges >> section and directed edges in the C<< *Arcs >> section.
=back
=head2 Input/Output class methods
=over 4
=item my ($bool, $errmsg) = Graph::Dijkstra->validateGraphMLxml( $filename );
Validates contents of $filename against GraphML XML schema L<http://graphml.graphdrawing.org/xmlns/1.1/graphml.xsd>
$bool is true (1) and $errmsg is empty if file contents are validated against schema. Otherwise, $bool is false (0) and $errmsg is set.
=item my ($bool, $errmsg) = Graph::Dijkstra->validateGEXFxml( $filename );
Validates contents of $filename against GEXF XML schema L<http://www.gexf.net/1.2draft/gexf.xsd>
$bool is true (1) and $errmsg is empty if file contents are validated against schema. Otherwise, $bool is false (0) and $errmsg is set.
=back
=head1 CHANGE HISTORY
=head2 Version 0.3
o Initial development release (first release that indexed correctly on CPAN)
=head2 Version 0.4
o Added input/output methods for Pajek (NET) format files
o Lots of incompatible changes.
o Changed references to edge attribute labels to consistently use: sourceID, targetID, and weight.
o In the farthestNode and shortestPath methods, changed origin and destination to originID and destinationID as the starting and endpoint node ID values.
o Changed the node, edge, removeEdge, adjacent, and edgeExists methods to use hash references as parameters. Get version of node method returns hash reference.
> Thought is that using hash references as parameters will better support future addition of graph, node, and edge attributes.
o Changed the farthestNode and shortestPath methods to input the node ID value(s) in the solution hash reference parameter as "originID" and "destinationID".
o Changed the solution hash reference returned by the farthestNode, shortestPath methods to use sourceID, targetID, and weight as hash attributes replacing source, target, and cost
o Added two graph level attributes: label and creator. Attributes are input / output from / to files as supported by that format.
o Updated new method to accept an optional parameter hash (reference) with graph attributes
o Added graph method to update (set) or return (get) graph attributes.
o In files produced by the outputGraphto[file format] methods (exlcuding CSV files), added a comment "Generated by Graph::Dijkstra on [localtime string]". In JSON, comment is a "metadata" attribute of the Graph object.
o Validated that JSON text created by outputGraphtoJSON conforms to the JSON Graph Specification schema.
o Always bug fixes.
o Updated test scripts.
=head2 Version 0.41
o Updated edge (GET) method to return a hash reference with three attributes: sourceID, targetID, and weight.
=head2 Version 0.50
o Added initial support for directed edges throughout (in addition to undirected). Not extensively tested.
o Added three attributes to edge: 'id', 'label', and 'directed' (directed/undirected).
o Added graph attribute 'edgedefault' (directed/undirected).
o Added three readonly attribute hashes with default values for graph, node, and edge elements. Expectation is that new attributes can be supported by updating the default hashes.
o Updated format for CSV files (incompatible change) and rewrote associated input/output methods.
o Added two "helper" class methods: stringifyAttribs and hashifyAttribs.
o Added utf8::upgrade calls for all graph, node, and edge attribute values.
o Added tests for directed and undirected edges.
=head2 Version 0.55
o Modified inputGraphfrom[format] methods to also work as class methods that create and populate an internal graph instance.
o Updated (bug fix) outputGraphtoGEXF to include version attribute in gexf element as required by schema.
o Updated (bug fix) outputGraphtoGraphML and inputGraphfromGraphML to output and input graph element label values using the key element id / data key value "graphlabel" to avoid conflict with the edge label id value ("label")
o Added two class methods, validateGraphMLxml and validateGEXFxml, that validate the contents of XML files against the GraphML and GEXF schemas.
o Used the two new class validate[format]xml methods to validate the contents of xml files produced by outputGraphtoGraphML and outputGraphtoGEXF
=head2 Version 0.56
o Modified VERBOSE method to accept an optional filehandle to redirect informational output.
o Modified inputGraphfromGEXF method to input weight from either edge attribute weight (weight="9.9") or edge attvalues/attvalue element C<< <attvalue for="weight" value="9.9" /> >>.
o Fixed bug in computation methods related to nodes with inbound but no outbound edges (directed))
o Corrected / updated documentation (POD).
=head2 Version 0.60
o Added Floyd Warshall variant of vertexCenter method and added tests.
o Refactored (substantially rewrote) edge method and added tests.
o Updated validateGraphMLxml and validateGEXFxml class methods to check for schema parse errors indicating that schema URL is not available; updated tests.
o Documentation (POD) updates.
=head2 Version 0.70
o Refactored internal representation of graph edges and nodes: separate hash structures within the graph object
o Fixed subtle bug in removeNode method
o Added nodeIDsList method and integrated into outputGraphto* methods replacing direct access to internal graph object data
o Added two private methods, _getEdgeAttrib and _edgeExists, and integrated into computation and outputGraphto* methods replacing direct access to internal graph object data
=head1 PLATFORM DEPENDENCIES
Critical module depencies are XML::LibXML and Array::Heap::ModifiablePriorityQueue which itself uses Array::Heap. XML::LibXML and Array::Head are XS modules.
XML::LibXML requires the c library libxml2.
( run in 1.725 second using v1.01-cache-2.11-cpan-39bf76dae61 )