diff --git a/python/conda package/k_hop_dominating_set_gurobi/k_hop_dominating_set_gurobi/k_hop_dom_set.py b/python/conda package/k_hop_dominating_set_gurobi/k_hop_dominating_set_gurobi/k_hop_dom_set.py index 5e022f49f1f4f232233220ceef86a811438466e2..a832d499f80cf9590c2c946736e1695b3d4b8e12 100755 --- a/python/conda package/k_hop_dominating_set_gurobi/k_hop_dominating_set_gurobi/k_hop_dom_set.py +++ b/python/conda package/k_hop_dominating_set_gurobi/k_hop_dominating_set_gurobi/k_hop_dom_set.py @@ -118,57 +118,6 @@ class RootedConnectecKHopDominatingSet(ConnectedKHopDominatingSet): self.m.addConstr(self.nodes[root] >= 1) - # for i in G.nodes: - # if(i not in G.neighbors(root) and i is not root): - # min_ij_sep = ConnectedKHopDominatingSet.min_ij_separator(G, i, root, {i}) - # self.m.addConstr(gp.quicksum(self.nodes[s] for s in min_ij_sep) >= self.nodes[i]) - - # for i in G.nodes: - # for j in G.nodes: - # if i != j and j not in G.neighbors(i): - # min_ij_sep = ConnectedKHopDominatingSet.min_ij_separator(self.G, i, j, {i}) - # self.m.addConstr(gp.quicksum(self.nodes[s] for s in min_ij_sep) >= self.nodes[i] + self.nodes[j] - 1) - - - # All Neighbor separators - # for v in G.nodes: - # if v is not root and root not in G.neighbors(v) and v not in G.neighbors(root) and not set(G.neighbors(root)).intersection(set(G.neighbors(v))): - # for i in range(2,G.degree[v]): - # V = {w for w in G.neighbors(v)} - # V.update([v]) - # # for i_neighborhood in combinations(V, 2): - # for i_neighborhood in combinations(V, i): - # if v in i_neighborhood: - # min_ij_sep = ConnectedKHopDominatingSet.min_ij_separator(G, v, root, set(i_neighborhood)) - # self.m.addConstr(gp.quicksum(self.nodes[s] for s in min_ij_sep) >= self.nodes[v]) - - # All separators from single root - # for v in G.nodes: - # # if v is not root and root not in G.neighbors(v) and v not in G.neighbors(root) and not set(G.neighbors(root)).intersection(set(G.neighbors(v))): - # for i in range(2,len(G.nodes)): - # V = {w for w in G.neighbors(v)} - # V.update([v]) - # # for i_neighborhood in combinations(V, 2): - # for i_neighborhood in combinations(V, i): - # if v in i_neighborhood: - # min_ij_sep = ConnectedKHopDominatingSet.min_ij_separator(G, v, root, set(i_neighborhood)) - # if min_ij_sep: - # self.m.addConstr(gp.quicksum(self.nodes[s] for s in min_ij_sep) >= self.nodes[v]) - - # for v in G.nodes: - # # if v is not root and root not in G.neighbors(v) and v not in G.neighbors(root) and not set(G.neighbors(root)).intersection(set(G.neighbors(v))): - # for i in range(2,len(G.nodes)): - # V = {w for w in G.neighbors(v)} - # V.update([v]) - # # for i_neighborhood in combinations(V, 2): - # for i_neighborhood in combinations(V, i): - # if v in i_neighborhood: - # for h in G.nodes: - # min_ij_sep = ConnectedKHopDominatingSet.min_ij_separator(G, v, h, set(i_neighborhood)) - # if min_ij_sep: - # self.m.addConstr(gp.quicksum(self.nodes[s] for s in min_ij_sep) >= self.nodes[v]) - - def add_single_root_separators(self): for i in self.G.nodes: min_ij_sep = ConnectedKHopDominatingSet.min_ij_separator(G, i, self.root, {i})