public void writeToAdjacencyMatrix(String file){
        int[][] A = new int[network.size()][network.size()];
        for(Node N:network)
        {
            for(int i=0;i<N.getDegree();i++)
            {
                A[N.id][N.getNeighbour(i).id] = 1;
            }
        }
        try
        {
            BufferedWriter out = new BufferedWriter(new FileWriter(file));
            String row = "";
            for(int i=0;i<A.length;i++)
            {
                row = "";
                for(int j =0;j<A.length;j++)
                {
                    row += A[i][j] + " ";
                }
                row += "\n";
                out.write(row);
            }
            out.flush();
            out.close();
        }
        catch (IOException ex)
        {
            Logger.getLogger(experiment.class.getName()).log(Level.SEVERE, null, ex);
        }
    }