Graph Algorithms

class graph_algorithm.GraphAlgorithmPlugin
get_communities(self: graph_algorithm.GraphAlgorithmPlugin, netlist: hal_py.Netlist) → Dict[int, Set[hal_py.Gate]]

Get a dict of community IDs to communities. Each community is represented by a set of gates.

Parameters:netlist (hal_py.Netlist) – The netlist to operate on.
Returns:A dict from community IDs to communities.
Return type:dict[int,set[hal_py.get_gate()]]
get_communities_fast_greedy(self: graph_algorithm.GraphAlgorithmPlugin, netlist: hal_py.Netlist) → Dict[int, Set[hal_py.Gate]]

Get a dict of community IDs to communities running the fast greedy clustering algorithm from igraph. Each community is represented by a set of gates.

Parameters:netlist (hal_py.Netlist) – The netlist to operate on.
Returns:A dict from community IDs to communities.
Return type:dict[set[hal_py.get_gate()]]
get_communities_spinglass(self: graph_algorithm.GraphAlgorithmPlugin, netlist: hal_py.Netlist, spins: int) → Dict[int, Set[hal_py.Gate]]

Get a dict of community IDs to communities running the spinglass clustering algorithm. Each community is represented by a set of gates.

Parameters:
  • netlist (hal_py.Netlist) – The netlist to operate on.
  • spins (int) – The number of spins.
Returns:

A dict from community IDs to communities.

Return type:

dict[int,set[hal_py.get_gate()]]

get_graph_cut(self: graph_algorithm.GraphAlgorithmPlugin, netlist: hal_py.Netlist, gate: hal_py.Gate, depth: int = 4294967295, terminal_gate_type: Set[str] = set()) → List[Set[hal_py.Gate]]

Get a graph cut for a specific gate and depth. Further, a set of gates can be specified that limit the graph cut, i.e., flip-flops and memory cells. The graph cut is returned as a list of sets of gates with the list’s index representing the distance of each set to the starting point.

Parameters:
  • netlist (hal_py.Netlist) – The netlist to operate on.
  • gate (hal_py.get_gate()) – The gate that is the starting point for the graph cut.
  • depth (int) – The depth of the graph cut.
  • terminal_gate_type (set[str]) – A set of gates at which to terminate the graph cut.
Returns:

The graph cut as a list of sets of gates.

Return type:

list[set[hal_py.get_gate()]]

get_name(self: graph_algorithm.GraphAlgorithmPlugin) → str

Get the name of the plugin.

Returns:Plugin name.
Return type:str
get_strongly_connected_components(self: graph_algorithm.GraphAlgorithmPlugin, netlist: hal_py.Netlist) → List[List[hal_py.Gate]]

Get a list of strongly connected components (SCC) with each SSC being represented by a list of gates.

Parameters:netlist (hal_py.Netlist) – The netlist to operate on.
Returns:A list of SCCs.
Return type:list[list[hal_py.get_gate()]]
get_version(self: graph_algorithm.GraphAlgorithmPlugin) → str

Get the version of the plugin.

Returns:Plugin version.
Return type:str
name

The name of the plugin.

Type:str
version

The version of the plugin.

Type:str