def weight_curve(self, edge):
        seen_edges = set([cn_edge(edge)])
        nodes = list(edge[:2])

        while nodes:
            node = nodes.pop()
            edges = self.pixel_graph.edges(node, data=True)
            if len(edges) != 2:
                # This node is not part of a curve
                continue
            for edge in edges:
                edge = cn_edge(edge)
                if edge not in seen_edges:
                    seen_edges.add(edge)
                    nodes.extend(n for n in edge if n != node)
        return len(seen_edges)
Weight diagonals based on curve length.
dataset/ETHPy150Open jerith/depixel/depixel/depixeler.py/FullyConnectedHeuristics.weight_curve