title: JGrapht: dynamic graph error after adding the vertices and edges
body: <p>Hope you're doing well !
  I'm trying to code a program where i'll need to create a dynamic weighted graph and get the shortest path from one Vertex to another. But after running the program I get this exception:</p>
  
  <pre><code>run:
  TEST1
  TEST Vertex Add
  Exception in thread "main" java.lang.IllegalArgumentException: no such vertex in graph: 1
  at org.jgrapht.graph.AbstractGraph.assertVertexExist(AbstractGraph.java:132)
  at org.jgrapht.graph.AbstractBaseGraph.addEdge(AbstractBaseGraph.java:141)
  at dijkstra.Dijkstra.main(Dijkstra.java:26)
  C:\Users\Lucas\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
  BUILD FAILED (total time: 0 seconds)
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>    import org.jgrapht.*;
      import org.jgrapht.alg.*;
      import org.jgrapht.graph.*;
      import java.util.List;
      import java.util.concurrent.ThreadLocalRandom;
      import org.jgrapht.alg.shortestpath.DijkstraShortestPath;
  
      public class Dijkstra {
  public static void main(String args[]) {
  
      SimpleWeightedGraph&lt;String, DefaultWeightedEdge&gt;  graph = new SimpleWeightedGraph&lt;String, DefaultWeightedEdge&gt;(DefaultWeightedEdge.class);
  
      int i = generateNumberByRange(1,5);
  
       System.out.println("TEST1");
      for(int j=0; j&lt;i; j++){
  
        graph.addVertex(String.valueOf(j));
        System.out.println("TEST Vertex Add");
  
      }
      for(int j=0;j&lt;i;j++){
  
        DefaultWeightedEdge e1 = graph.addEdge(String.valueOf(j),String.valueOf(j+1)); 
        graph.setEdgeWeight(e1, generateNumberByRange(10,20));
        System.out.println(graph.getEdgeWeight(e1));
      }
  
      System.out.println("TEST2");
        graph.addVertex(String.valueOf(i));
        DefaultWeightedEdge e = graph.addEdge("0","1"); 
        graph.setEdgeWeight(e, generateNumberByRange(10,20)); 
  
  
      System.out.println("TEST3");
  
      System.out.println("Shortest path from START to END:");
      //List shortest_path =   DijkstraShortestPath.findPathBetween(graph,"0",String.valueOf(i));
      List shortest_path;
      //shortest_path = DijkstraShortestPath.findPathBetween(graph, "0","2");
      //System.out.println(shortest_path);
  
  }
  
       public static int generateNumberByRange(int START, int END){
       return ThreadLocalRandom.current().nextInt(START, END + 1);
        }
        }
  </code></pre>