From e4ee1f8a1e5707a4d8478a678a03ce664ae8f894 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 2 Nov 2015 15:49:23 +0100 Subject: Working on report --- Practical1/report/implementation.tex | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Practical1/report/implementation.tex') diff --git a/Practical1/report/implementation.tex b/Practical1/report/implementation.tex index 5c6bbff..6df8932 100644 --- a/Practical1/report/implementation.tex +++ b/Practical1/report/implementation.tex @@ -3,7 +3,7 @@ A Java application accompanies this report. I have chosen for a simple implementation of a vertex: -\begin{minted}[fontsize=\footnotesize,linenos,breaklines,tabsize=0]{java} +\begin{minted}[fontsize=\footnotesize,linenos,tabsize=0]{java} class Node implements Comparable> { private final T content; private final List> neighbours = new ArrayList<>(); @@ -39,7 +39,7 @@ The graph therefore has a stack of lists of nodes as a private member. Every ele That gives us the signature of the \texttt{Graph} class: -\begin{minted}[fontsize=\footnotesize,linenos,breaklines,tabsize=0]{java} +\begin{minted}[fontsize=\footnotesize,linenos,tabsize=0]{java} class Graph { private final List> nodes; private final Stack>> restorePoints = new Stack<>(); @@ -74,10 +74,11 @@ The \texttt{addNode} and \texttt{getNode} methods are simply wrappers for the \t Using these two classes in the problem at hand turns out to be as simple as: -\begin{minted}[fontsize=\footnotesize,linenos,breaklines,tabsize=0]{java} +\begin{minted}[fontsize=\footnotesize,linenos,tabsize=0]{java} Graph graph = new Graph(); int n_bins = readGraph(new Scanner(System.in), graph); - System.out.println(graph.maximumIndependentSetSize() >= n_bins ? "possible" : "impossible"); + int miss = graph.maximumIndependentSetSize(); + System.out.println(miss >= n_bins ? "possible" : "impossible"); \end{minted} A suitable implementation of \texttt{readGraph} is outside the scope of this report. -- cgit v1.2.3