@staticmethod
    def vertexLabelExamples(graph):
        numFeatures = graph.getVertexList().getNumFeatures()
        numEdges = graph.getNumEdges()

        #Also add non-edges
        logging.info("Computing graph complement")
        cGraph = graph.complement()
        logging.info("Done with " + str(cGraph.getNumEdges()) + " edges.")
        perm = numpy.random.permutation(cGraph.getNumEdges())[0:numEdges]

        X = GraphUtils.vertexLabelPairs(graph, graph.getAllEdges())
        Xc = GraphUtils.vertexLabelPairs(cGraph, cGraph.getAllEdges()[perm, :])
        X = numpy.r_[X, Xc]

        y = numpy.ones(numEdges*2)
        y[numEdges:numEdges*2] = -1
        logging.debug(y)

        #If the graph is undirected add reverse edges
        if graph.isUndirected():
            X2 = numpy.zeros((numEdges*2, numFeatures*2))
            X2[:, 0:numFeatures] = X[:, numFeatures:numFeatures*2]
            X2[:, numFeatures:numFeatures*2] = X[:, 0:numFeatures]
            X = numpy.r_[X, X2]
            y = numpy.r_[y, y]

        return X, y
Return a set of examples with pairs of vertex labels connected by an
dataset/ETHPy150Open charanpald/APGL/apgl/graph/GraphUtils.py/GraphUtils.vertexLabelExamples