graph_utils

graph_utils#

Full path: iqm.applications.graph_utils

Contains utility functions regarding graphs which are generic enough that they deserve having their own module.

Module Attributes

NODE_ATTR_PRIORITY

Ordered names of node attributes that may store node weights.

EDGE_ATTR_PRIORITY

Ordered names of edge attributes that may store edge weights.

Functions

draw_problem([problem_instance, ...])

High-level wrapper that prepares and visualizes a problem graph.

get_top_n_color_pairs(max_color_pairs[, ...])

Helper function for the greedy router.

plot_graph(plot_data)

Renders the graph using matplotlib and networkx.

prepare_plot_data(data[, seed])

Generates all layout and color data required for visualization.

relabel_graph_nodes(graph)

Map original node labels of the Graph to consecutive integers starting from 0.

residual_degree(graph, node, visited)

The degree of node in the graph, with regards to only non-visited nodes.

Classes

PlotData

Precomputed visualization information used for drawing the graph.

ProblemData

Normalized problem information extracted and validated before plotting.

Inheritance

Inheritance diagram of iqm.applications.graph_utils