Research Article

An Algorithm Tool for Atom Decomposition and Interaction: AD Visualiser

Algorithm 1

DAG drawing algorithm.
Input: An Ontology O
Output: A DAG g
(1)adAtomicDecomposition(O);
(2)DirectedGraph(ad);
(3)graphNodes←0/;
(4)topAtomstopatomsad
(5)dep(atom)←atomsdependenciesofatom
(6)foreachatomtopAtoms do
(7)graphNodesgraphNodesatom;
(8)end for
(9)repeat
10if atom/graphNodes then
(11)graphNodesgraphNodesatom;
(12)endif
(13)if dep(atom) = 0/then
(14)for eachatomChilddep(atom)do
(15)if atomChild/graphNodes then
(16)graphNodesgraphNodesatomChild;
(17)endif
(18)endfor
(19)endif
(20)until add all the atoms in graphNodes of ad
(21)repeat
(22)if ad.getDependencies(atom).size()! = 0then
(23)foreachatomChild ∈ ad.getDependencies(atom)do
(24)g.addEdge(atom, atomChild);
(25)endfor
(26)endif
(27)until draw all the edges
(28)show the result g;