def labels(self, source):
        if self.oriented is False:
            print 'cannot apply labels, graph is not oriented'
            return
        arg_sort = np.array(self.topological_sort())
        sorted_BSs = self.BSs[arg_sort]

        for i in range(len(sorted_BSs)):
            bs_i = []
            for e in sorted_BSs[i]:
                try:
                    bs_i.append(np.where(arg_sort == e)[0][0])
                except:
                    print 'error'
            sorted_BSs[i] = np.array(bs_i)

        pred = np.empty((self.n), dtype=np.int)
        pred[source] = 0
        edges = np.array([], dtype=object)

        f = []
        f.append(source)
        for t in range(1, len(arg_sort)):
            prev_costs = []
            for p in sorted_BSs[t]:
                prev_costs.append(f[p] + self.qu[arg_sort[p]][arg_sort[t]])

            f.append(min(prev_costs))
            pred[t] = sorted_BSs[t][np.argmin(prev_costs)]
            edges = np.append(edges, None)
            edges[-1] = [arg_sort[pred[t]], arg_sort[t]]
        return edges
Returns the WKT representation of the Geometry.
dataset/ETHPy150Open dnlcrl/PyGraphArt/src/graph.py/Graph.labels--crossover with--dataset/ETHPy150Open dcramer/django-compositepks/django/contrib/gis/gdal/geometries.py/OGRGeometry.wkt