The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Graph::Easy::Parser::Graph6 - read graph6 or sparse6 file to a Graph::Easy graph

SYNOPSIS

 use Graph::Easy::Parser::Graph6;
 my $parser = Graph::Easy::Parser::Graph6->new;
 $graph = $parser->from_file('foo.g6');
 $graph = $parser->from_text(':Fa@x^');

CLASS HIERARCHY

Graph::Easy::Parser::Graph6 is a subclass of Graph::Easy::Parser.

    Graph::Easy::Parser
      Graph::Easy::Parser::Graph6

DESCRIPTION

Graph::Easy::Parser::Graph6 reads a graph6, sparse6 or digraph6 format file to create a Graph::Easy graph object. These file formats are per

The formats represent a graph with vertices numbered 0 to n-1. These are made into Graph::Easy vertex names as strings like "000" to "999" with however many decimal digits are needed for the number of vertices. These names are designed to be round-trip clean to an alphabetical re-write.

graph6 and sparse6 are undirected, so $graph is set undirected. sparse6 can have multi-edges and self loops. They are added to the graph with multiple add_edge() in the usual way. digraph6 is directed.

See Graph::Graph6 for further notes on the formats. See examples/graph-easy-print.pl for a complete sample program.

FUNCTIONS

$parser = Graph::Easy::Parser::Graph6->new (key=>value, ...)

Create and return a new parser object. The key/value options are per Graph::Easy::Parser.

$graph = Graph::Easy::Parser::Graph6->from_file ($filename)
$graph = $parser->from_file ($filename)
$graph = $parser->from_text ($str)

Read the given filename or string and return a new Graph::Easy graph.

For compatibility with Graph::Easy::Parser, if $filename is a reference then it's assumed to be a file handle, though this is not documented in Graph::Easy::Parser as of its version 0.76. The suggestion is to pass only a plain string for a filename.

SEE ALSO

Graph::Easy, Graph::Easy::Parser, Graph::Easy::As_graph6, Graph::Easy::As_sparse6

nauty-showg(1), Graph::Graph6

HOME PAGE

http://user42.tuxfamily.org/graph-graph6/index.html

LICENSE

Copyright 2015, 2016, 2017, 2018 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/.