Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
general
albi
Bachelor Mario Surlemont
Commits
4cba3dc1
Commit
4cba3dc1
authored
May 26, 2020
by
msurl
Browse files
deleted outcommented code
parent
89a50a18
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/conda package/k_hop_dominating_set_gurobi/k_hop_dominating_set_gurobi/k_hop_dom_set.py
View file @
4cba3dc1
...
@@ -118,57 +118,6 @@ class RootedConnectecKHopDominatingSet(ConnectedKHopDominatingSet):
...
@@ -118,57 +118,6 @@ class RootedConnectecKHopDominatingSet(ConnectedKHopDominatingSet):
self
.
m
.
addConstr
(
self
.
nodes
[
root
]
>=
1
)
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
):
def
add_single_root_separators
(
self
):
for
i
in
self
.
G
.
nodes
:
for
i
in
self
.
G
.
nodes
:
min_ij_sep
=
ConnectedKHopDominatingSet
.
min_ij_separator
(
G
,
i
,
self
.
root
,
{
i
})
min_ij_sep
=
ConnectedKHopDominatingSet
.
min_ij_separator
(
G
,
i
,
self
.
root
,
{
i
})
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment