public void stop() {
        /*if (algorithm != null)
            algorithm.defaultSettings();*/
        if (savedRandomInitiation) {
            Vertex.randomInit.setInitial(1);
        }
        GUI.controls.refresh();
        if (state == RunState.stopped)
            return;
        state = RunState.stopped;
        for (Vertex v : graph.vertices)
            v.program.kill();
        for (Edge e : graph.edges)
            e.restart();
        graph.setDefaultValues();
        observer = null;
        MessageQueue.messageCount = 0;
        GUI.informationPanel.erase();
        GUI.gRepaint();
    }