adds Graph class
implements Dikstra's algorithm