def compute_compatibilty_matrix(self):
        """
        Compatibility is stored in a matrix (rows = edges, columns = edges). 
        Every coordinate in the matrix tells whether the two edges (r,c)/(c,r) 
        are compatible, or not. The diagonal is always zero, and the other fields 
        are filled with either -1 (not compatible) or 1 (compatible). 
        The matrix is symmetric. 
        """
        edges_as_geom = []
        edges_as_vect = []
        for e_idx, edge in enumerate(self.edges):
            geom = edge.geometry()
            edges_as_geom.append(geom)
            edges_as_vect.append(QgsVector(geom.vertexAt(1).x() - geom.vertexAt(0).x(), 
                                           geom.vertexAt(1).y() - geom.vertexAt(0).y()))
            self.edge_lengths.append(edges_as_vect[e_idx].length())