pennylane_calculquebec.utility.graph.node_with_shortest_path_from_selection

pennylane_calculquebec.utility.graph.node_with_shortest_path_from_selection#

pennylane_calculquebec.utility.graph.node_with_shortest_path_from_selection(source: int, selection: list[int], graph: Graph, machine_name: str, use_benchmark=True)#

find the unmapped node node in graph minus mapped nodes that has shortest path to given source node

Parameters:
  • source (int) – the source node

  • selection (list[int]) – a selection of nodes to consider in operation

  • graph (Graph) – the graph to work on

  • machine_name (str) – the name of the machine. Usually yukon or yamaska

  • use_benchmark (bool) – should we use real benchmarks for this operation?

Returns:

the closest node to source that was contained in selection

Return type:

int