safemdp.reachable_set(graph, initial_nodes, out=None)

Compute the safe, reachable set of a graph


graph: nx.DiGraph

Directed graph. Each edge must have associated action metadata, which specifies the action that this edge corresponds to. Each edge has an attribute [‘safe’], which is a boolean that indicates safety

initial_nodes: list

List of the initial, safe nodes that are used as a starting point to compute the reachable set.

out: np.array

The array to write the results to. Is assumed to be False everywhere except at the initial nodes


reachable_set: np.array

Boolean array that indicates whether a node belongs to the reachable set.