annotate toolboxes/FullBNT-1.0.7/GraphViz/draw_graph_test.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 % TEST_LAYOUT Script to test some bayesian net layouts
Daniel@0 2 %
Daniel@0 3
Daniel@0 4 % Change History :
Daniel@0 5 % Date Time Prog Note
Daniel@0 6 % 13-Apr-2000 10:40 PM ATC Created under MATLAB 5.3.1.29215a (R11.1)
Daniel@0 7
Daniel@0 8 % ATC = Ali Taylan Cemgil,
Daniel@0 9 % SNN - University of Nijmegen, Department of Medical Physics and Biophysics
Daniel@0 10 % e-mail : cemgil@mbfys.kun.nl
Daniel@0 11
Daniel@0 12 %bnet = mk_asia_bnet;
Daniel@0 13 %draw_graph(bnet.dag);
Daniel@0 14
Daniel@0 15 % Make the following network (from Jensen (1996) p84 fig 4.17)
Daniel@0 16 % 1
Daniel@0 17 % / | \
Daniel@0 18 % 2 3 4
Daniel@0 19 % | | |
Daniel@0 20 % 5 6 7
Daniel@0 21 % \/ \/
Daniel@0 22 % 8 9
Daniel@0 23 % where all arcs point downwards
Daniel@0 24
Daniel@0 25 disp('plot directed')
Daniel@0 26 clf;
Daniel@0 27
Daniel@0 28 N = 9;
Daniel@0 29 dag = zeros(N,N);
Daniel@0 30 dag(1,2)=1; dag(1,3)=1; dag(1,4)=1;
Daniel@0 31 dag(2,5)=1; dag(3,6)=1; dag(4,7)=1;
Daniel@0 32 dag(5,8)=1; dag(6,8)=1; dag(6,9)=1; dag(7,9) = 1;
Daniel@0 33
Daniel@0 34 draw_graph(dag);
Daniel@0 35
Daniel@0 36 pause
Daniel@0 37 clf
Daniel@0 38 disp('plot undirected')
Daniel@0 39 udag = [dag+dag'];
Daniel@0 40 draw_graph(udag);
Daniel@0 41
Daniel@0 42 pause
Daniel@0 43 clf
Daniel@0 44 disp('plot mixed')
Daniel@0 45 mg = [dag];
Daniel@0 46 mg(2,1) = 1; mg(8,5) = 1;
Daniel@0 47 draw_graph(mg);
Daniel@0 48
Daniel@0 49
Daniel@0 50