shortest_path¶
-
safemdp.
shortest_path
(source, next_sample, G)¶ Computes shortest safe path from a source to the next state-action pair the agent needs to sample
Parameters: source: int
Staring node for the path
next_sample: (int, int)
Next state-action 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