| Summary | Included libraries | Package variables | Synopsis | Description | General documentation | Methods |
| Summary | Top |
| Clair::GraphWrapper::Boost - Concrete class for Boost graphs |
| Package variables | Top |
| No package variables defined. |
| Included modules | Top |
| Boost::Graph |
| Clair::GraphWrapper |
| Inherit | Top |
| Clair::GraphWrapper |
| Synopsis | Top |
| my $graph = new Clair::GraphWrapper::Boost(); my $network = new Clair::Network(graph => $graph); |
| Description | Top |
| This object is a class for Boost graph objects used by the Network class. |
| Methods | Top |
| add_edge | No description | Code |
| add_vertex | No description | Code |
| all_pairs_shortest_paths_johnson | No description | Code |
| breadth_first_search | No description | Code |
| connected_components | No description | Code |
| degree | No description | Code |
| delete_edge | No description | Code |
| edges | No description | Code |
| has_edge | No description | Code |
| in_degree | No description | Code |
| is_directed | No description | Code |
| new | No description | Code |
| out_degree | No description | Code |
| predecessors | No description | Code |
| successors | No description | Code |
| vertices | No description | Code |
| add_edge | description | prev | next | Top |
sub add_edge
{ my $self = shift;
my $u = shift;
my $v = shift;
$self->{graph}->add_edge($u, $v);} |
| add_vertex | description | prev | next | Top |
sub add_vertex
{ my $self = shift;
my $n = shift;
$self->{graph}->add_node($n);} |
| all_pairs_shortest_paths_johnson | description | prev | next | Top |
sub all_pairs_shortest_paths_johnson
{ my $self = shift;
return $self->{graph}->all_pairs_shortest_paths_johnson(@_);} |
| breadth_first_search | description | prev | next | Top |
sub breadth_first_search
{ my $self = shift;
return $self->{graph}->breadth_first_search(@_);} |
| connected_components | description | prev | next | Top |
sub connected_components
{ my $self = shift;
my $graph = $self->{graph};
my $c = $graph->connected_components();
# use Data::Dumper;} |
| degree | description | prev | next | Top |
sub degree
{ my $self = shift;
my $v = shift;
return scalar(@{$self->{graph}->neighbors($v)});} |
| delete_edge | description | prev | next | Top |
sub delete_edge
{ my $self = shift;
my $u = shift;
my $v = shift;
my $graph = $self->{graph};
$graph->remove_edge($u, $v);} |
| edges | description | prev | next | Top |
sub edges
{ my $self = shift;
my $edges = $self->{graph}->get_edges();
return map { [$_->[0], $_->[1]] } @{$edges};} |
| has_edge | description | prev | next | Top |
sub has_edge
{ my $self = shift;
my $u = shift;
my $v = shift;
return $self->{graph}->has_edge($u, $v);} |
| in_degree | description | prev | next | Top |
sub in_degree
{ my $self = shift;
my $v = shift;
return scalar(@{$self->{graph}->parents_of_directed($v)});} |
| is_directed | description | prev | next | Top |
sub is_directed
{ my $self = shift;
return $self->{directed};} |
| new | description | prev | next | Top |
sub new
{ my $class = shift;
my %parameters = @_;
my $directed = 1;
if ((exists $parameters{directed} and $parameters{directed} == 0) ||
(exists $parameters{undirected} and $parameters{undirected} == 1)) {
$directed = 0;
}
my $unionfind = 0;
if (exists $parameters{unionfind} and $parameters{unionfind} == 1) {
$unionfind = 1;
}
my $graph;
if (exists $parameters{graph}) {
# If user specified graph, use that} |
| out_degree | description | prev | next | Top |
sub out_degree
{ my $self = shift;
my $v = shift;
return scalar(@{$self->{graph}->children_of_directed($v)});} |
| predecessors | description | prev | next | Top |
sub predecessors
{ my $self = shift;
my $n = shift;
return @{$self->{graph}->parents_of_directed($n)};} |
| successors | description | prev | next | Top |
sub successors
{ my $self = shift;
my $n = shift;
return @{$self->{graph}->children_of_directed($n)};} |
| vertices | description | prev | next | Top |
sub vertices
{ my $self = shift;
my $vertices = $self->{graph}->get_nodes();
return @{$vertices};} |