public void load(String name) {
        clearAll();
        try {

            coordToName.clear();
            graph.clear();

            FileInputStream fis = new FileInputStream(name);
            ObjectInput ois = new ObjectInputStream(fis);
            List<SerializableVertex> l = (List<SerializableVertex>) ois.readObject();
            ois.close();

            for (SerializableVertex v : l) {
                graph.addVertex(v.x, v.y, v.name);
            }

            for (SerializableVertex v : l) {
                for (Edge e : v.adj) {
                    graph.addEdge(e.src.name, e.dest.name, e.cost);
                }
            }

            for (Vertex v : graph.getVertices()) {
                coordToName.put(new Point(v.x, v.y), v.name);
            }

            repaint();

        } catch (Exception ex) {
            Logger.getLogger(Drawing.class.getName()).log(Level.SEVERE, null, ex);
        }

    }