To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / _FullBNT / BNT / graph / test.m @ 8:b5b38998ef3b
History | View | Annotate | Download (288 Bytes)
| 1 |
% A - B |
|---|---|
| 2 |
% | |
| 3 |
% D - C - E |
| 4 |
|
| 5 |
A=1;B=2;C=3;D=4;E=5; |
| 6 |
dag = zeros(5,5); |
| 7 |
dag(A,B)=1; |
| 8 |
%dag(A,D)=1; |
| 9 |
dag(B,C)=1; |
| 10 |
dag(C,D)=1; |
| 11 |
dag(E,C)=1; |
| 12 |
[d, pre, post, cycle, f, pred] = dfs(dag, A, 0) |
| 13 |
|
| 14 |
[T, pre, post, cycle] = mk_rooted_tree(dag, A) |
| 15 |
|
| 16 |
%[T, pre, post, cycle] = mkRootedTree(dag, A) |