about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/graph/test.m
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes/bnt-master/graph/test.m')
-rw-r--r--sourcecodes/bnt-master/graph/test.m16
1 files changed, 16 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/graph/test.m b/sourcecodes/bnt-master/graph/test.m
new file mode 100644
index 00000000..6ffe3d2e
--- /dev/null
+++ b/sourcecodes/bnt-master/graph/test.m
@@ -0,0 +1,16 @@
+% A - B
+%     |
+% D - C - E
+
+A=1;B=2;C=3;D=4;E=5;
+dag = zeros(5,5);
+dag(A,B)=1;
+%dag(A,D)=1;
+dag(B,C)=1;
+dag(C,D)=1;
+dag(E,C)=1;
+[d, pre, post, cycle, f, pred] = dfs(dag, A, 0)
+
+[T, pre, post, cycle] = mk_rooted_tree(dag, A)
+
+%[T, pre, post, cycle] = mkRootedTree(dag, A)