From ONE original connected simple UNDIRECTED labelled graph on vertices0..n wit...
https://datenvertrag.halowerk.com/v1/rotor-router-tree-action-ledgerOverview
From ONE original connected simple UNDIRECTED labelled graph on vertices0..n with1..3 NONSINK vertices0..n-1 and sink=n, a supplied original sink-rooted spanning TREE parent vector and a chip start<n, compute the rotor-router chip-addition action on that TREE. edge_mask names lexicographic unordered pairs(u,v),u<v,bit0 first. Each nonsink rotor initially points to parents[v]. OWN ribbon convention: outgoing neighbors are in increasing numeric cyclic order, wrapping last to first.