Graph-Graph6
view release on metacpan or search on metacpan
lib/Graph/Graph6.pm view on Meta::CPAN
multi-edges. The file size ranges from B = E*(W+1)/6 bytes up to 2*B bytes,
for E edges and bit width W bits for the biggest vertex number N-1.
digraph6 represents a directed graph as an NxN adjacency matrix of bits
encoded as 6 bits per character so file size N^2/6 bytes. It can include
self-loops but no multi-edges.
=cut
# GP-DEFINE graph6_size_bits_by_sum(n) = sum(j=1,n-1, sum(i=0, j-1, 1));
# GP-DEFINE graph6_size_bits_formula(n) = n*(n-1)/2;
# GP-Test vector(100,n, graph6_size_bits_formula(n)) == \
# GP-Test vector(100,n, graph6_size_bits_by_sum(n))
# GP-DEFINE graph6_size_bits_formula(n) = n^2/2 - n/2;
# GP-Test vector(100,n, graph6_size_bits_formula(n)) == \
# GP-Test vector(100,n, graph6_size_bits_by_sum(n))
=pod
This module reads and writes in a "native" way as integer vertex numbers 0
to n-1. See L</SEE ALSO> below for C<Graph.pm>, C<Graph::Easy> and
C<GraphViz2> interfaces.
These formats are used by the Nauty tools L<http://cs.anu.edu.au/~bdm/nauty>
and L<http://pallini.di.uniroma1.it> as output for generated graphs and
( run in 0.320 second using v1.01-cache-2.11-cpan-26ccb49234f )