def test_random_graph(self):

        G = nx.Graph()

        points = [(random(), random()) for _ in range(100)]

        # Build a path from points[0] to points[-1] to be sure it exists
        for p1, p2 in pairwise(points):
            G.add_edge(p1, p2, weight=dist(p1, p2))

        # Add other random edges
        for _ in range(100):
            p1, p2 = choice(points), choice(points)
            G.add_edge(p1, p2, weight=dist(p1, p2))

        path = nx.astar_path(G, points[0], points[-1], dist)
        assert_equal(path, nx.dijkstra_path(G, points[0], points[-1]))
Initializes the object.
dataset/ETHPy150Open networkx/networkx/networkx/algorithms/shortest_paths/tests/test_astar.py/TestAStar.test_random_graph--crossover with--dataset/ETHPy150Open enthought/traitsui/traitsui/context_value.py/ContextValue.__init__