shortest_path¶

safemdp.
shortest_path
(source, next_sample, G)¶ Computes shortest safe path from a source to the next stateaction pair the agent needs to sample
Parameters: source: int
Staring node for the path
next_sample: (int, int)
Next stateaction pair the agent needs to sample. First entry is the number that indicates the state. Second entry indicates the action
G: networkx DiGraph
Graph that indicates the dynamics. It is linked to S matrix
Returns: path: list
shortest safe path