Эх сурвалжийг харах

write more about those assumptions

Eren Yilmaz 6 жил өмнө
parent
commit
494c1bd587

+ 9 - 3
doc/chapter/2architecture.tex

@@ -6,19 +6,25 @@ The following assumptions are made for the implementation of the node placement
     \item There are no labels.
     \item There are no cross-hierarchy edges.
     \item No edges over multiple layers (the previous phases should have added dummy nodes).
-    \item Graphs are connected (maybe we will get rid of this assumption later, see chapter~\ref{ch:progress}).
+    \item Graphs are connected (see below).
 \end{itemize}
 
+Regarding the last assumption, we found an example where for a disconnected graph the algorithm behaved incorrectly.
+Maybe we will get rid of this assumption later, see chapter~\ref{ch:progress}.
+We are currently investigating another example, where the algorithm behaves incorrectly for a connected graph.
+These two examples are included in the appendix (figures~\ref{fig:error_disconnected_img},~\ref{fig:error_connected_img},~\ref{fig:error_disconnected}, and~\ref{fig:error_connected},).
+
 
 \section{Overview}\label{sec:components}
 The \code{main} package contains an executable class \code{Main}.
 This classes main method reads a graph from a file using the \code{graph.io} package and then creates a MainView.
+It is also possible to create a MainView directly from an \code{ElkNode}.
 The view then instantiates a \code{BKNodePlacement} algorithm and runs it.
 The \code{BKNodePlacement} repeatedly asks the \code{AnimationController} if a step should be done (this is further explained in section~\ref{sec:theActualAlgorithm}).
 It uses \code{LayeredGraphNode}s and \code{LayeredGraphEdge}s.
 Meanwhile the view displays the same \code{LayeredGraphNode}s and \code{LayeredGraphEdge}s on the screen.
 
-Figure~\ref{fig:components} contains a component diagram that illustrates these dependencies of the packages.
+Figure~\ref{fig:components} contains a component diagram that illustrates these dependencies of the different packages.
 
 \begin{figure}[htp]
     \centering
@@ -95,7 +101,7 @@ The internal representation of graphs is further explained in the section~\ref{s
 \begin{figure}
     \begin{lstinputlisting}[language=json,emph={}]{src/graph.json}
     \end{lstinputlisting}
-    \caption[Example Input File]{Example Input file that is understood by \appname.}
+    \caption[Example input file]{Example input file that is understood by \appname.}
     \label{fig:json-example}
 \end{figure}
 

+ 35 - 2
doc/chapter/appendix.tex

@@ -28,7 +28,7 @@
 
 \begin{figure}[htp]
     \centering
-    \includegraphics{img/random-graph-dialog}
+    \includegraphics[width=0.33\linewidth]{img/random-graph-dialog}
     \caption[Random graph dialog]{Dialog for generating random graphs.}
     \label{fig:random-graph-dialog}
 \end{figure}
@@ -38,4 +38,37 @@
     \includegraphics[width=\linewidth]{img/debug-table}
     \caption[Debug Table]{An example for a debug table. The graph used is the same as in figure~\ref{fig:example}}
     \label{fig:debug-table}
-\end{figure}
+\end{figure}
+
+\begin{figure}[htp]
+    \centering
+    \includegraphics[width=0.33\linewidth]{img/error_disconnected}
+    \caption[Error caused by disconnected graph]{An illustration of the error caused by the graph displayed in figure~\ref{fig:error_disconnected}.
+    In the lowest layer the two nodes are drawn at the same position.}
+    \label{fig:error_disconnected_img}
+\end{figure}
+
+\begin{figure}[htp]
+    \centering
+    \includegraphics[width=0.33\linewidth]{img/error_connected}
+    \caption[Error caused by connected graph]{An illustration of the error caused by the graph displayed in figure~\ref{fig:error_connected}.
+    In the fourth layer the last two nodes are drawn at the same position.}
+    \label{fig:error_connected_img}
+\end{figure}
+
+\begin{figure}
+    \begin{lstinputlisting}[language=json,emph={},basicstyle=\scriptsize\ttfamily,numberstyle=\tiny]{src/error_disconnected.json}
+    \end{lstinputlisting}
+    \caption[Disconnected graph causing an error]{Example graph where the node placement algorithm does not behave correctly, possibly because it is not connected.
+    The error is illustrated in figure~\ref{fig:error_disconnected_img}.}
+    \label{fig:error_disconnected}
+\end{figure}
+
+\begin{figure}
+    \begin{lstinputlisting}[language=json,emph={},basicstyle=\tiny\ttfamily,numberstyle=\tiny]{src/error_connected.json}
+    \end{lstinputlisting}
+    \caption[Connected graph causing an error]{Example graph where the node placement algorithm does not behave correctly, even though it is connected.
+    We did not check yet if this is a problem with our implementation or with the node placement algorithm itself.
+    The error is illustrated in figure~\ref{fig:error_connected_img}.}
+    \label{fig:error_connected}
+\end{figure}

BIN
doc/img/error_connected.png


BIN
doc/img/error_disconnected.png


+ 67 - 0
doc/src/error_connected.json

@@ -0,0 +1,67 @@
+{
+  "layers": [
+    [
+      { "name": "4" }
+    ],
+    [
+      { "name": "8" },
+      { "name": "9" }
+    ],
+    [
+      { "name": "11" }
+    ],
+    [
+      { "name": "16" },
+      { "name": "17" },
+      { "name": "18" },
+      { "name": "19" }
+    ],
+    [
+      { "name": "23" },
+      { "name": "24" }
+    ]
+  ],
+  "edges": [
+    {
+      "source": "4",
+      "target": "9"
+    },
+    {
+      "source": "4",
+      "target": "8"
+    },
+    {
+      "source": "8",
+      "target": "11"
+    },
+    {
+      "source": "11",
+      "target": "16"
+    },
+    {
+      "source": "11",
+      "target": "18"
+    },
+    {
+      "source": "18",
+      "target": "24"
+    },
+    {
+      "source": "19",
+      "target": "24"
+    },
+    {
+      "source": "17",
+      "target": "23"
+    },
+    {
+      "source": "16",
+      "target": "23"
+    },
+    {
+      "source": "18",
+      "target": "23"
+    }
+  ]
+}
+

+ 44 - 0
doc/src/error_disconnected.json

@@ -0,0 +1,44 @@
+{
+   "layers":[
+      [
+      { "name": "n0" },
+      { "name": "n1" },
+      { "name": "n2" }
+      ],
+      [
+      { "name": "n3" },
+      { "name": "n4" },
+      { "name": "n5" }
+      ],
+      [
+      { "name": "n6" },
+      { "name": "n7" }
+      ]
+   ],
+   "edges":[
+      {
+         "source":"n0",
+         "target":"n5"
+      },
+      {
+         "source":"n1",
+         "target":"n5"
+      },
+      {
+         "source":"n2",
+         "target":"n5"
+      },
+      {
+         "source":"n3",
+         "target":"n7"
+      },
+      {
+         "source":"n4",
+         "target":"n7"
+      },
+      {
+         "source":"n5",
+         "target":"n7"
+      }
+   ]
+}

+ 32 - 32
doc/src/graph.json

@@ -1,36 +1,36 @@
 {
-  "layers": [
-    [
+   "layers":[
+      [
+         {
+            "width":10,
+            "height":10
+         },
+         {
+            "name":"n1",
+            "width":10,
+            "height":10,
+            "layers":[
+               [
+                  {
+                     "name":"n2",
+                     "width":10,
+                     "height":10
+                  }
+               ]
+            ]
+         }
+      ],
+      [
+         {
+            "name":"n2"
+         }
+      ]
+   ],
+   "edges":[
       {
-        "width": 10,
-        "height": 10
-      },
-      {
-        "name": "n1",
-        "width": 10,
-        "height": 10,
-        "layers": [
-          [
-            {
-              "name": "n2",
-              "width": 10,
-              "height": 10
-            }
-          ]
-        ]
-      }
-    ],
-    [
-      {
-        "name": "n2"
+         "source":"n1",
+         "target":"n2"
       }
-    ]
-  ],
-  "edges": [
-    {
-      "source": "n1",
-      "target": "n2"
-    }
-  ],
-  "name": "n0"
+   ],
+   "name":"n0"
 }