⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graph.pod

📁 nasm早期的源代码,比较简单是学习汇编和编译原理的好例子
💻 POD
📖 第 1 页 / 共 5 页
字号:
With

=over 4

=item transitive_closure_matrix

   $tcm = $g->transitive_closure_matrix;

=back

you can (create if not existing and) query the transitive closure
matrix that underlies the transitive closure graph.  See
L<Graph::TransitiveClosure::Matrix> for more information.

=head2 Mutators

=over 4

=item add_vertices

    $g->add_vertices('d', 'e', 'f')

Add zero or more vertices to the graph.

=item add_edges

    $g->add_edges(['d', 'e'], ['f', 'g'])
    $g->add_edges(qw(d e f g));

Add zero or more edges to the graph.  The edges are specified as
a list of array references, or as a list of vertices where the
even (0th, 2nd, 4th, ...) items are start vertices and the odd
(1st, 3rd, 5th, ...) are the corresponding end vertices.

=back

=head2 Accessors

=over 4

=item is_directed

=item directed

    $g->is_directed()
    $g->directed()

Return true if the graph is directed, false otherwise.

=item is_undirected

=item undirected

    $g->is_undirected()
    $g->undirected()

Return true if the graph is undirected, false otherwise.

=item is_refvertexed

=item refvertexed

Return true if the graph can handle references (including Perl objects)
as vertices.

=item vertices

    my $V = $g->vertices
    my @V = $g->vertices

In scalar context, return the number of vertices in the graph.
In list context, return the vertices, in no particular order.

=item has_vertices

    $g->has_vertices()

Return true if the graph has any vertices, false otherwise.

=item edges

    my $E = $g->edges
    my @E = $g->edges

In scalar context, return the number of edges in the graph.
In list context, return the edges, in no particular order.
I<The edges are returned as anonymous arrays listing the vertices.>

=item has_edges

    $g->has_edges()

Return true if the graph has any edges, false otherwise.

=item is_connected

    $g->is_connected

For an undirected graph, return true is the graph is connected, false
otherwise.  Being connected means that from every vertex it is possible
to reach every other vertex.

If the graph has been created with a true C<unionfind> parameter,
the time complexity is (essentially) O(V), otherwise O(V log V).

See also L</connected_components>, L</connected_component_by_index>,
L</connected_component_by_vertex>, and L</same_connected_components>,
and L</biconnectivity>.

For directed graphs, see L</is_strongly_connected>
and L</is_weakly_connected>.

=item connected_components

    @cc = $g->connected_components()

For an undirected graph, returns the vertices of the connected
components of the graph as a list of anonymous arrays.  The ordering
of the anonymous arrays or the ordering of the vertices inside the
anonymous arrays (the components) is undefined.

For directed graphs, see L</strongly_connected_components>
and L</weakly_connected_components>.

=item connected_component_by_vertex

    $i = $g->connected_component_by_vertex($v)

For an undirected graph, return an index identifying the connected
component the vertex belongs to, the indexing starting from zero.

For the inverse, see L</connected_component_by_index>.

If the graph has been created with a true C<unionfind> parameter,
the time complexity is (essentially) O(1), otherwise O(V log V).

See also L</biconnectivity>.

For directed graphs, see L</strongly_connected_component_by_vertex>
and L</weakly_connected_component_by_vertex>.

=item connected_component_by_index

    @v = $g->connected_component_by_index($i)

For an undirected graph, return the vertices of the ith connected
component, the indexing starting from zero.  The order of vertices is
undefined, while the order of the connected components is same as from
connected_components().

For the inverse, see L</connected_component_by_vertex>.

For directed graphs, see L</strongly_connected_component_by_index>
and L</weakly_connected_component_by_index>.

=item same_connected_components

    $g->same_connected_components($u, $v, ...)

For an undirected graph, return true if the vertices are in the same
connected component.

If the graph has been created with a true C<unionfind> parameter,
the time complexity is (essentially) O(1), otherwise O(V log V).

For directed graphs, see L</same_strongly_connected_components>
and L</same_weakly_connected_components>.

=item connected_graph

    $cg = $g->connected_graph

For an undirected graph, return its connected graph.

=item connectivity_clear_cache

    $g->connectivity_clear_cache

See L</"Clearing cached results">.

See L</"Connected Graphs and Their Components"> for further discussion.

=item biconnectivity

    my ($ap, $bc, $br) = $g->biconnectivity

For an undirected graph, return the various biconnectivity components
of the graph: the articulation points (cut vertices), biconnected
components, and bridges.

Note: currently only handles connected graphs.

=item is_biconnected

   $g->is_biconnected

For an undirected graph, return true if the graph is biconnected
(if it has no articulation points, also known as cut vertices).

=item is_edge_connected

   $g->is_edge_connected

For an undirected graph, return true if the graph is edge-connected
(if it has no bridges).

=item is_edge_separable

   $g->is_edge_separable

For an undirected graph, return true if the graph is edge-separable
(if it has bridges).

=item articulation_points

=item cut_vertices

   $g->articulation_points

For an undirected graph, return the articulation points (cut vertices)
of the graph as a list of vertices.  The order is undefined.

=item biconnected_components

   $g->biconnected_components

For an undirected graph, return the biconnected components of the
graph as a list of anonymous arrays of vertices in the components.
The ordering of the anonymous arrays or the ordering of the vertices
inside the anonymous arrays (the components) is undefined.  Also note
that one vertex can belong to more than one biconnected component.

=item biconnected_component_by_vertex

   $i = $g->biconnected_component_by_index($v)

For an undirected graph, return an index identifying the biconnected
component the vertex belongs to, the indexing starting from zero.

For the inverse, see L</connected_component_by_index>.

For directed graphs, see L</strongly_connected_component_by_index>
and L</weakly_connected_component_by_index>.

=item biconnected_component_by_index

   @v = $g->biconnected_component_by_index($i)

For an undirected graph, return the vertices in the ith biconnected
component of the graph as an anonymous arrays of vertices in the
component.  The ordering of the vertices within a component is
undefined.  Also note that one vertex can belong to more than one
biconnected component.

=item same_biconnected_components

    $g->same_biconnected_components($u, $v, ...)

For an undirected graph, return true if the vertices are in the same
biconnected component.

=item biconnected_graph

    $bcg = $g->biconnected_graph

For an undirected graph, return its biconnected graph.

See L</"Connected Graphs and Their Components"> for further discussion.

=item bridges

   $g->bridges

For an undirected graph, return the bridges of the graph as a list of
anonymous arrays of vertices in the bridges.  The order of bridges and
the order of vertices in them is undefined.

=item biconnectivity_clear_cache

    $g->biconnectivity_clear_cache

See L</"Clearing cached results">.

=item strongly_connected

=item is_strongly_connected

    $g->is_strongly_connected

For a directed graph, return true is the directed graph is strongly
connected, false if not.

See also L</is_weakly_connected>.

For undirected graphs, see L</is_connected>, or L</is_biconnected>.

=item strongly_connected_component_by_vertex

    $i = $g->strongly_connected_component_by_vertex($v)

For a directed graph, return an index identifying the strongly
connected component the vertex belongs to, the indexing starting from
zero.

For the inverse, see L</strongly_connected_component_by_index>.

See also L</weakly_connected_component_by_vertex>.

For undirected graphs, see L</connected_components> or
L</biconnected_components>.

=item strongly_connected_component_by_index

    @v = $g->strongly_connected_component_by_index($i)

For a directed graph, return the vertices of the ith connected
component, the indexing starting from zero.  The order of vertices
within a component is undefined, while the order of the connected
components is the as from strongly_connected_components().

For the inverse, see L</strongly_connected_component_by_vertex>.

For undirected graphs, see L</weakly_connected_component_by_index>.

=item same_strongly_connected_components

    $g->same_strongly_connected_components($u, $v, ...)

For a directed graph, return true if the vertices are in the same
strongly connected component.

See also L</same_weakly_connected_components>.

For undirected graphs, see L</same_connected_components> or
L</same_biconnected_components>.

=item strong_connectivity_clear_cache

    $g->strong_connectivity_clear_cache

See L</"Clearing cached results">.

=item weakly_connected

=item is_weakly_connected

    $g->is_weakly_connected

For a directed graph, return true is the directed graph is weakly
connected, false if not.

Weakly connected graph is also known as I<semiconnected> graph.

See also L</is_strongly_connected>.

For undirected graphs, see L</is_connected> or L</is_biconnected>.

=item weakly_connected_components

    @wcc = $g->weakly_connected_components()

For a directed graph, returns the vertices of the weakly connected
components of the graph as a list of anonymous arrays.  The ordering
of the anonymous arrays or the ordering of the vertices inside the
anonymous arrays (the components) is undefined.

See also L</strongly_connected_components>.

For undirected graphs, see L</connected_components> or
L</biconnected_components>.

=item weakly_connected_component_by_vertex

    $i = $g->weakly_connected_component_by_vertex($v)

For a directed graph, return an index identifying the weakly connected
component the vertex belongs to, the indexing starting from zero.

For the inverse, see L</weakly_connected_component_by_index>.

For undirected graphs, see L</connected_component_by_vertex>
and L</biconnected_component_by_vertex>.

=item weakly_connected_component_by_index

    @v = $g->weakly_connected_component_by_index($i)

For a directed graph, return the vertices of the ith weakly connected
component, the indexing starting zero.  The order of vertices within
a component is undefined, while the order of the weakly connected
components is same as from weakly_connected_components().

For the inverse, see L</weakly_connected_component_by_vertex>.

For undirected graphs, see L<connected_component_by_index>
and L<biconnected_component_by_index>.

=item same_weakly_connected_components

    $g->same_weakly_connected_components($u, $v, ...)

Return true if the vertices are in the same weakly connected component.

=item weakly_connected_graph

    $wcg = $g->weakly_connected_graph

For a directed graph, return its weakly connected graph.

For undirected graphs, see L</connected_graph> and L</biconnected_graph>.

=item strongly_connected_components

   my @scc = $g->strongly_connected_components;

For a directed graph, return the strongly connected components as a
list of anonymous arrays.  The elements in the anonymous arrays are
the vertices belonging to the strongly connected component; both the
elements and the components are in no particular order.

See also L</weakly_connected_components>.

For undirected graphs, see L</connected_components>,
or see L</biconnected_components>.

=item strongly_connected_graph

   my $scg = $g->strongly_connected_graph;

See L</"Connected Graphs and Their Components"> for further discussion.

Strongly connected graphs are also known as I<kernel graphs>.

See also L</weakly_connected_graph>.

For undirected graphs, see L</connected_graph>, or L</biconnected_graph>.

=item is_sink_vertex

    $g->is_sink_vertex($v)

Return true if the vertex $v is a sink vertex, false if not.  A sink
vertex is defined as a vertex with predecessors but no successors:
this definition means that isolated vertices are not sink vertices.
If you want also isolated vertices, use is_successorless_vertex().

=item is_source_vertex

    $g->is_source_vertex($v)

Return true if the vertex $v is a source vertex, false if not.  A source
vertex is defined as a vertex with successors but no predecessors:
the definition means that isolated vertices are not source vertices.
If you want also isolated vertices, use is_predecessorless_vertex().

=item is_successorless_vertex

    $g->is_successorless_vertex($v)

Return true if the vertex $v has no succcessors (no edges
leaving the vertex), false if it has.

Isolated vertices will return true: if you do not want this,
use is_sink_vertex().

=item is_successorful_vertex

    $g->is_successorful_vertex($v)

Return true if the vertex $v has successors, false if not.

=item is_predecessorless_vertex

    $g->is_predecessorless_vertex($v)

Return true if the vertex $v has no predecessors (no edges
entering the vertex), false if it has.

Isolated vertices will return true: if you do not want this,
use is_source_vertex().

=item is_predecessorful_vertex

    $g->is_predecessorful_vertex($v)

Return true if the vertex $v has predecessors, false if not.

=item is_isolated_vertex

    $g->is_isolated_vertex($v)

Return true if the vertex $v is an isolated vertex: no successors
and no predecessors.

=item is_interior_vertex

    $g->is_interior_vertex($v)

Return true if the vertex $v is an interior vertex: both successors
and predecessors.

=item is_exterior_vertex

    $g->is_exterior_vertex($v)

Return true if the vertex $v is an exterior vertex: has either no
successors or no predecessors, or neither.

=item is_self_loop_vertex

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -