Skip to content

Commit

Permalink
Obtain selected nodes and edges as those
Browse files Browse the repository at this point in the history
for which value of indicator > 0.5.
  • Loading branch information
lmanan committed Apr 24, 2024
1 parent 5415cd4 commit 06608fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions motile/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ def get_selected_subgraph(
selected_graph = TrackGraph()

for node_id, node in self.graph.nodes.items():
if solution[node_selected[node_id]]:
if solution[node_selected[node_id]] > 0.5:
selected_graph.add_node(node_id, node)

for edge_id, edge in self.graph.edges.items():
if solution[edge_selected[edge_id]]:
if solution[edge_selected[edge_id]] > 0.5:
selected_graph.add_edge(edge_id, edge)

return selected_graph

0 comments on commit 06608fe

Please sign in to comment.