Graph::BitMatrix
create and manipulate a V x V bit matrix of graph G
- Provided by: libgraph-perl (Version: 1:0.9704-1)
- Report a bug
create and manipulate a V x V bit matrix of graph G
use Graph::BitMatrix;
use Graph::Directed;
my $g = Graph::Directed->new;
$g->add_...(); # build $g
my $m = Graph::BitMatrix->new($g, %opt);
$m->get($u, $v)
$m->set($u, $v)
$m->unset($u, $v)
$m->get_row($u, $v1, $v2, ..., $vn)
$m->set_row($u, $v1, $v2, ..., $vn)
$m->unset_row($u, $v1, $v2, ..., $vn)
$a->vertices()
This class enables creating bit matrices that compactly describe the connected of the graphs.
If true or if not present, set the bits in the bit matrix that correspond to edges. If false, do not set any bits. In either case the bit matrix of V x V bits is allocated.
The algorithm used to create the matrix is two nested loops, which is O(V**2) in time, and the returned matrices are O(V**2) in space.
Jarkko Hietaniemi jhi@iki.fi
This module is licensed under the same terms as Perl itself.