From f720c1f35d83a4b638632f038775dae059457aa7 Mon Sep 17 00:00:00 2001 From: kalashnikovni Date: Mon, 8 Jul 2024 10:25:03 -0300 Subject: [PATCH] Added SCC cycle test --- test/scc4.test | 4 ++-- test/scc5.test | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 test/scc5.test diff --git a/test/scc4.test b/test/scc4.test index 034ed8b..319aaf0 100644 --- a/test/scc4.test +++ b/test/scc4.test @@ -1,8 +1,8 @@ // SCC test, with a long path, and a branch in the middle // that goes to a minimum value -N = 100 -N2 = 50 +N = 100000 +N2 = 50000 V1 = 1 V2 = N+V1 diff --git a/test/scc5.test b/test/scc5.test new file mode 100644 index 0000000..ce7a6f9 --- /dev/null +++ b/test/scc5.test @@ -0,0 +1,41 @@ +// SCC test with a single long path, with small cycles +// between pairs of vertices + +N = 100000 + +V1 = 1 +V2 = N-1+V1 +V3 = N+V2 + +E1 = 1 +E2 = N-1+E1 +E3 = N-1+E2 +E4 = N-1+E3 + +off1b = r(V1, 1)-r(E1, 1) +off2b = r(V3, 1)-r(E2, 1)-1 +off3b = r(V2, 1)-r(E3, 1) +off4b = r(V2, 1)-r(E4, 1) + +off1d = r(V3, 1)-r(E1, 1)-N+1 +off2d = r(V2, 1)-r(E2, 1) +off3d = r(V3, 1)-r(E3, 1) +off4d = r(V3, 1)-r(E4, 1)-1 + +V %= {[1:1:V1], [V1+1:1:V2], [V2+1:1:V3]}; +Vmap %= <<{[1:1:V1]} -> 0*x+1, {[V1+1:1:V2]} -> 0*x+2, {[V2+1:1:V3]} -> 0*x+3>>; +mapB %= <<{[1:1:E1]} -> 1*x+off1b, {[E1+1:1:E2]} -> 1*x+off2b, {[E2+1:1:E3]} -> 1*x+off3b + , {[E3+1:1:E4]} -> 1*x+off4b>>; +mapD %= <<{[1:1:E1]} -> 1*x+off1d, {[E1+1:1:E2]} -> 1*x+off2d, {[E2+1:1:E3]} -> 1*x+off3d + , {[E3+1:1:E4]} -> 1*x+off4d>>; +Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2], [E2+1:1:E3], [E3+1:1:E4]} -> 0*x+2>>; + +scc( + V %= {[1:1:V1], [V1+1:1:V2], [V2+1:1:V3]}; + Vmap %= <<{[1:1:V1]} -> 0*x+1, {[V1+1:1:V2]} -> 0*x+2, {[V2+1:1:V3]} -> 0*x+3>>; + mapB %= <<{[1:1:E1]} -> 1*x+off1b, {[E1+1:1:E2]} -> 1*x+off2b, {[E2+1:1:E3]} -> 1*x+off3b + , {[E3+1:1:E4]} -> 1*x+off4b>>; + mapD %= <<{[1:1:E1]} -> 1*x+off1d, {[E1+1:1:E2]} -> 1*x+off2d, {[E2+1:1:E3]} -> 1*x+off3d + , {[E3+1:1:E4]} -> 1*x+off4d>>; + Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2], [E2+1:1:E3], [E3+1:1:E4]} -> 0*x+2>>; +)