pub fn articulation_points<G>(graph: G) -> Vec<G::NodeId>
where
    G: IntoNodeIdentifiers + IntoNeighbors + NodeIndexable,
{
    let mut cut_points = Vec::new();
    let mut visited = vec![false; graph.node_bound()];
    let mut is_cut_point = vec![false; graph.node_bound()];
    let mut tin = vec![0usize; graph.node_bound()];
    let mut fup = vec![0usize; graph.node_bound()];
    let mut timer = 0usize;

    for start in 0..graph.node_bound() {
        if !visited[start] {
            ap_dfs_helper(
                graph,
                start,
                graph.node_bound() + 1,
                &mut is_cut_point,
                &mut cut_points,
                &mut visited,
                &mut timer,
                &mut tin,
                &mut fup,
            );
        }
    }

    cut_points
}
/// Find all [articulation points](https://www.geeksforgeeks.org/articulation-points-or-cut-vertices-in-a-graph/)
/// in a simple undirected graph.
///
/// In a graph, a vertex is called an articulation point if removing it and all
/// the edges associated with it increases the number of connected components in the graph.
///
/// Returns the vector of `G::NodeID`.
///
/// # Examples
///
/// ```
/// use petgraph::algo::articulation_points;
/// use petgraph::graph::UnGraph;
///
/// // Create the following graph:
/// // 0----1    4
/// //      | __/|
/// // 5----2/---3
///
/// let mut g = UnGraph::new_undirected();
/// let n0 = g.add_node(());
/// let n1 = g.add_node(());
/// let n2 = g.add_node(());
/// let n3 = g.add_node(());
/// let n4 = g.add_node(());
/// let n5 = g.add_node(());
/// g.add_edge(n0, n1, ());
/// g.add_edge(n1, n2, ());
/// g.add_edge(n2, n3, ());
/// g.add_edge(n3, n4, ());
/// g.add_edge(n2, n4, ());
/// g.add_edge(n5, n2, ());
///
/// // The articulation points of this graph are vertices 1 and 2.
/// assert_eq!(articulation_points(&g), vec![n2, n1]);
/// ```
Find all [articulation points]
in a simple undirected graph.

In a graph, a vertex is called an articulation point if removing it and all
the edges associated with it increases the number of connected components in the graph.

Returns the vector of `G::NodeID`.
Find all [ articulation points ] in a simple undirected graph . In a graph a vertex is called an articulation point if removing it and all the edges associated with it increases the number of connected components in the graph . Returns the vector of ` G :: NodeID ` .
pub fn articulation_points<G>(graph: G) -> Vec<G::NodeId>
where
    G: IntoNodeIdentifiers + IntoNeighbors + NodeIndexable,
{
    let mut cut_points = Vec::new();
    let mut visited = vec![false; graph.node_bound()];
    let mut is_cut_point = vec![false; graph.node_bound()];
    let mut tin = vec![0usize; graph.node_bound()];
    let mut fup = vec![0usize; graph.node_bound()];
    let mut timer = 0usize;
    for start in 0..graph.node_bound() {
        if !visited[start] {
            ap_dfs_helper(
                graph,
                start,
                graph.node_bound() + 1,
                &mut is_cut_point,
                &mut cut_points,
                &mut visited,
                &mut timer,
                &mut tin,
                &mut fup,
            );
        }
    }
    cut_points
}
pub fn articulation_points < G > ( graph : G ) -> Vec < G :: NodeId > where G : IntoNodeIdentifiers + IntoNeighbors + NodeIndexable , { let mut cut_points = Vec :: new ( ) ; let mut visited = vec ! [ false graph node_bound ( ) ] ; let mut is_cut_point = vec ! [ false graph node_bound ( ) ] ; let mut tin = vec ! [ 0usize graph node_bound ( ) ] ; let mut fup = vec ! [ 0usize graph node_bound ( ) ] ; let mut timer = 0usize ; for start in 0 .. graph . node_bound ( ) { if ! visited [ start ] { ap_dfs_helper ( graph , start , graph . node_bound ( ) + 1 , & mut is_cut_point , & mut cut_points , & mut visited , & mut timer , & mut tin , & mut fup , ) ; } } cut_points }
Find all [articulation points](https://www.geeksforgeeks.org/articulation-points-or-cut-vertices-in-a-graph/)
in a simple undirected graph.
Find all [ articulation points ] ( https : // www . geeksforgeeks . org / articulation - points - or - cut - vertices - in - a - graph / ) in a simple undirected graph .
graph
G
examples
```
use petgraph::algo::articulation_points;
use petgraph::graph::UnGraph.





The articulation points of this graph are vertices 1 and 2.
` ` ` use petgraph :: algo :: articulation_points ; use petgraph :: graph :: UnGraph . The articulation points of this graph are vertices 1 and 2 .