qat.opt.results.GraphPartitioningResult

For a combinatorial optimization problem involving a graph, the batch generator can return a parsed result that includes a parsed version of the best Sample, that could be displayed.

class qat.opt.results.GraphPartitioningResult(graph, *args, **kwargs)

Class describing a graph partitioning. This class allows for the representation of a solution of a graph combinatorial optimization problem under the form of a networkx graph to provide a visual display to the solution

display(with_figure=False, figsize=(6.4, 4.8), node_size=300, font_size=12, **kwargs)

Display the partitions using the draw_networkx method from networkx

Parameters
  • with_figure (bool, optional) – wrap the displayed in a matplotlib.pyplot figure

  • figsize (tuple, optional) – the size of the matplotlib.pyplot figure, only used if with_figure is True

  • node_size (int, optional) – the size of the node in the diagram passed to the draw_networkx function

  • font_size (int, optional) – the font size in the diagram passed to the draw_networkx function