This is the documentation for the current state of the development branch of rustworkx. The documentation or APIs here can change prior to being released.
- PyGraph.find_node_by_weight(obj, /)#
Find node within this graph given a specific weight
This algorithm has a worst case of O(n) since it searches the node indices in order. If there is more than one node in the graph with the same weight only the first match (by node index) will be returned.
obj – The weight to look for in the graph.
the index of the first node in the graph that is equal to the weight. If no match is found
Nonewill be returned.
- Return type: