NAME
Graph::Easy::As_sparse6 - stringize Graph::Easy to sparse6 format
SYNOPSIS
use Graph::Easy;
my $graph = Graph::Easy->new;
$graph->add_edge('foo','bar');
use Graph::Easy::As_sparse6;
print $graph->as_sparse6;
DESCRIPTION
Graph::Easy::As_sparse6
adds an as_sparse6()
method to Graph::Easy
to give a graph as a string of sparse6 format. This format is per
The format represents an undirected graph possibly with multi-edges and self loops. If $graph
is directed then an edge in either direction is written. If there's edges both ways then a multi-edge is written.
The format has no vertex names and no attributes. In the current implementation nodes are sorted alphabetically (sorted_nodes('name')
) to give a consistent (though slightly arbitrary) vertex numbering.
See Graph::Graph6 for some notes on the format.
FUNCTIONS
The following new method is added to Graph::Easy
.
$str = $graph->as_sparse6 ()
-
Return a string which is the sparse6 representation of
$graph
.The string returned includes a final newline
"\n"
and so is suitable for writing directly to a file or similar.
SEE ALSO
Graph::Easy, Graph::Easy::As_graph6, Graph::Easy::Parser::Graph6
HOME PAGE
http://user42.tuxfamily.org/graph-graph6/index.html
LICENSE
Copyright 2015 Kevin Ryde
Graph-Graph6 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Graph-Graph6 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Graph-Graph6. If not, see http://www.gnu.org/licenses/.