Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion independentset.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def planar_independent_set(graph: Graph, black_list: List=list(), degree_lim=IND
"""
unmarked_nodes = {
node
for node in graph.nodes_iter()
for node in list(graph.nodes)
if graph.degree(node) <= degree_lim and
node not in black_list
}
Expand Down
8 changes: 4 additions & 4 deletions kirkpatrick.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def locate(self, p: Point, plot_search=False) -> Optional[Polygon]:
plt.clf()

i = 1
while len(self.digraph.neighbors(curr)) > 1:
while len(list(self.digraph.neighbors(curr))) > 1:
for node in self.digraph.neighbors(curr):
if p in node:
curr = node
Expand All @@ -270,11 +270,11 @@ def locate(self, p: Point, plot_search=False) -> Optional[Polygon]:
i+=1

# Access the original tile just below the polygon if it exists
neighbors = self.digraph.neighbors(curr)
neighbors = list(self.digraph.neighbors(curr))
if len(neighbors) == 1:
curr = neighbors[0]

if self.digraph.node[curr]["original"]:
if self.digraph.nodes[curr]["original"]:
return curr
return None

Expand Down Expand Up @@ -323,4 +323,4 @@ def time_tests(min_pts: int=10, max_pts: int=100, inc=5, n_iter=100) -> List[Poi

located_tile = locator.locate(query_point, plot_search=True)

print(located_tile)
print(located_tile)