def METHOD_NAME(self):
    try:
        from dijkstar import Graph
    except ImportError:
        raise ImportError(
            "You need to install the package `dijkstar`." "\nInstall dijkstar via `pip install --upgrade dijkstar`"
        )
    vertex = self.edges
    h, w = self.edges.shape[1::-1]
    graph = Graph(undirected=True)
    # Iterating over an image and avoiding boundaries
    for i in range(1, w - 1):
        for j in range(1, h - 1):
            G_x = float(vertex[i, j]) - float(vertex[i, j + 1])  # Center - right
            G_y = float(vertex[i, j]) - float(vertex[i + 1, j])  # Center - bottom
            G = np.sqrt((G_x) ** 2 + (G_y) ** 2)
            if G_x > 0 or G_x < 0:
                theeta = math.atan(G_y / G_x)
            else:
                theeta = 0
            # Theeta is rotated in clockwise direction (90 degrees) to align with edge
            theeta_a = theeta + math.pi / 2
            G_x_a = abs(G * math.cos(theeta_a)) + 0.00001
            G_y_a = abs(G * math.sin(theeta_a)) + 0.00001
            # Strongest Edge will have lowest weights
            W_x = 1 / G_x_a
            W_y = 1 / G_y_a
            # Assigning weights
            graph.add_edge((i, j), (i, j + 1), W_x)  # W_x is given to right of current vertex
            graph.add_edge((i, j), (i + 1, j), W_y)  # W_y is given to bottom of current vertex
    self.G = graph