plot_edge_coloring

plot_edge_coloring#

iqm.qaoa.transpiler.sparse.edge_coloring.plot_edge_coloring(graph, pos=None, color_palette=None, default_color='#00000000')[source]#

A method that plots the edge coloring of a graph.

Careful! Here the variable color_palette is a list of strings, to convey the colors for plotting the graph. It maps the colors as integers (i.e., indices of the list) into strings which actually describe the color to plot, e.g., ‘r’ for red. This is different from other function in this module where color_palette is a set of integers.

Parameters:
  • graph (Graph) – A Graph whose edge coloring we want to plot.

  • pos (dict[int, tuple[float, float]] | None) – A dictionary of positions for drawing graph (i.e., the layout). If not provided, it defaults to the circular layout.

  • color_palette (list[str] | None) – A list of strings describing the colors to use in the plot.

  • default_color (str) – The color to use for edges that don’t have a color assigned to them yet.

Return type:

None