Skip to content
Snippets Groups Projects
Commit 3e8babdd authored by Gabriel Gehrke's avatar Gabriel Gehrke
Browse files

changed fvs visualization to more aesthetically pleasing colors

parent 238fe972
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -41,9 +41,9 @@ def visualize_fvs(graph: nx.Graph, feedback_vertex_set: Set[Node]): ...@@ -41,9 +41,9 @@ def visualize_fvs(graph: nx.Graph, feedback_vertex_set: Set[Node]):
Draws a 'before-after' visualization of a given Feedback Vertex Set solution on a given graph. Draws a 'before-after' visualization of a given Feedback Vertex Set solution on a given graph.
""" """
layout = nx.layout.kamada_kawai_layout(graph) layout = nx.layout.kamada_kawai_layout(graph)
nx.draw_networkx(graph, pos=layout, node_color=["red" if p in feedback_vertex_set else "cyan" for p in graph.nodes()]) nx.draw_networkx(graph, pos=layout, node_color=["red" if p in feedback_vertex_set else "grey" for p in graph.nodes()])
plt.show() plt.show()
_graph = graph.copy() _graph = graph.copy()
_graph.remove_nodes_from(feedback_vertex_set) _graph.remove_nodes_from(feedback_vertex_set)
nx.draw_networkx(_graph, pos=layout, node_color="cyan") nx.draw_networkx(_graph, pos=layout, node_color="grey")
plt.show() plt.show()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment