def _init_acyclic_edges(self):
        print '''Warning: Generating acyclic edges is NP-hard, expect long times, very long for more than 500 nodes'''
        big_s = set([])
        for i in range(len(self.nodes)):
            # if len(self.BSs[i]) == 0:
            big_s.add(i)
            neighbours = rnd.randint(3, self.max_neighbours+1)
            query_res = self.nodes_tree.query(
                self.nodes[i], k=neighbours+1)
            hole = len(self.BSs[i]) != 0
            for tail, cost in zip(query_res[1][1:], query_res[0][1:]):
                if not hole:
                    self.FSs[i] = np.append(self.FSs[i], tail)
                    self.FS_costs[i] = np.append(self.FS_costs[i], cost)
                    self.BSs[tail] = np.append(self.BSs[tail], i)
                else:
                    temp_fs = self.FSs.copy()
                    temp_fs[i] = np.append(temp_fs[i], tail)
                    if not self.is_cyclic(temp_fs):
                        self.FSs[i] = temp_fs[i].copy()
                        self.FS_costs[i] = np.append(self.FS_costs[i], cost)
                        self.BSs[tail] = np.append(self.BSs[tail], i)
                    # elif self.negative_costs:
                    #     self.BSs[i] = np.append(self.BSs[i], tail)
                    #     self.FS_costs[tail] = np.append(
                    #         self.FS_costs[tail], -cost)
                    #     self.FSs[tail] = np.append(self.FSs[tail], i)

                #big_s = big_s.union(set([i for i in self.FSs[i]]))
Initialize random edges filling the FSs struct
dataset/ETHPy150Open dnlcrl/PyGraphArt/src/graph.py/Graph._init_acyclic_edges