# Path: clrs/_src/algorithms/graphs.py
# def dfs(A: _Array) -> _Out:
# def bfs(A: _Array, s: int) -> _Out:
# def topological_sort(A: _Array) -> _Out:
# def articulation_points(A: _Array) -> _Out:
# def bridges(A: _Array) -> _Out:
# def strongly_connected_components(A: _Array) -> _Out:
# def mst_kruskal(A: _Array) -> _Out:
#   def mst_union(u, v, in_mst, probes):
# def mst_prim(A: _Array, s: int) -> _Out:
# def bellman_ford(A: _Array, s: int) -> _Out:
# def dijkstra(A: _Array, s: int) -> _Out:
# def dag_shortest_paths(A: _Array, s: int) -> _Out:
# def floyd_warshall(A: _Array) -> _Out:
# def bipartite_matching(A: _Array, n: int, m: int, s: int, t: int) -> _Out:
#   D = np.copy(A)


from absl.testing import absltest
from clrs._src.algorithms import graphs
import numpy as np
    out, _ = graphs.dfs(UNDIRECTED)
    np.testing.assert_array_equal(expected_undirected, out)

  def test_bfs(self):
    expected_directed = np.array([0, 0, 2, 0, 1, 5])
    out, _ = graphs.bfs(DIRECTED, 0)
    np.testing.assert_array_equal(expected_directed, out)

    expected_undirected = np.array([0, 0, 1, 1, 0])
    out, _ = graphs.bfs(UNDIRECTED, 0)
    np.testing.assert_array_equal(expected_undirected, out)

  def test_topological_sort(self):
    expected_dag = np.array([3, 4, 0, 1, 4])
    out, _ = graphs.topological_sort(DAG)
    np.testing.assert_array_equal(expected_dag, out)

  def test_articulation_points(self):
    expected = np.array([1, 0, 0, 1, 0])
    out, _ = graphs.articulation_points(ANOTHER_UNDIRECTED)
    np.testing.assert_array_equal(expected, out)

  def test_bridges(self):
    expected = np.array([
        [0, 0, 0, 1, -1],
        [0, 0, 0, -1, -1],
        [0, 0, 0, -1, -1],
        [1, -1, -1, 0, 1],
        [-1, -1, -1, 1, 0],
    ])

# Path: clrs/_src/algorithms/graphs.py
# def dfs(A: _Array) -> _Out:
# def bfs(A: _Array, s: int) -> _Out:
# def topological_sort(A: _Array) -> _Out:
# def articulation_points(A: _Array) -> _Out:
# def bridges(A: _Array) -> _Out:
# def strongly_connected_components(A: _Array) -> _Out:
# def mst_kruskal(A: _Array) -> _Out:
#   def mst_union(u, v, in_mst, probes):
# def mst_prim(A: _Array, s: int) -> _Out:
# def bellman_ford(A: _Array, s: int) -> _Out:
# def dijkstra(A: _Array, s: int) -> _Out:
# def dag_shortest_paths(A: _Array, s: int) -> _Out:
# def floyd_warshall(A: _Array) -> _Out:
# def bipartite_matching(A: _Array, n: int, m: int, s: int, t: int) -> _Out:
#   D = np.copy(A)


# Path: clrs/_src/algorithms/graphs_test.py
from absl.testing import absltest
from clrs._src.algorithms import graphs
import numpy as np

    out, _ = graphs.dfs(UNDIRECTED)
    np.testing.assert_array_equal(expected_undirected, out)

  def test_bfs(self):
    expected_directed = np.array([0, 0, 2, 0, 1, 5])
    out, _ = graphs.bfs(DIRECTED, 0)
    np.testing.assert_array_equal(expected_directed, out)

    expected_undirected = np.array([0, 0, 1, 1, 0])
    out, _ = graphs.bfs(UNDIRECTED, 0)
    np.testing.assert_array_equal(expected_undirected, out)

  def test_topological_sort(self):
    expected_dag = np.array([3, 4, 0, 1, 4])
    out, _ = graphs.topological_sort(DAG)
    np.testing.assert_array_equal(expected_dag, out)

  def test_articulation_points(self):
    expected = np.array([1, 0, 0, 1, 0])
    out, _ = graphs.articulation_points(ANOTHER_UNDIRECTED)
    np.testing.assert_array_equal(expected, out)

  def test_bridges(self):
    expected = np.array([
        [0, 0, 0, 1, -1],
        [0, 0, 0, -1, -1],
        [0, 0, 0, -1, -1],
        [1, -1, -1, 0, 1],
        [-1, -1, -1, 1, 0],
    ])

    out, _ = graphs.bridges(ANOTHER_UNDIRECTED)