* Insert this node into the winning positions, and also all red nodes that counted down to 0 (recursively) due to being predecessors of an inserted node.
*/
/// Insert this node into the winning positions, and also all red nodes that counted down to 0 (recursively) due to being predecessors of an inserted node.
fninsert_node(
node:Rc<String>,
additional_winning:&mutAdditionalWinning,
...
...
@@ -66,9 +28,7 @@ fn insert_node(
}
}
/**
* Calculates new winning positions, iterative step
*/
/// Calculates new winning positions, iterative step.
/// A representation of a red node, with a mutable, shared counter. This counter will be initialized with the out-degree of the node, and then reduced when a successor is added to the winning set of nodes.
format!("Node {} did not define a player (green, red).",n1_id)
})?;
letn2=
greens
.get(n2_id)
.or_else(||reds.get(n2_id))
.ok_or_else(||{
format!("Node {} in the edge {}->{} did not define a player (green, red). Add a node to the list of nodes with this attribute above.",n2_id,n1_id,n2_id)