graph representations an edge class class edgedef __init__(self, , ,weight= )self self self weight weight def __lt__(self,other)return self weight other weight running dijkstra' algorithm benefits from having both the edge and vertex objects the weight of each edge is needed by the algorithm so storing the weight in the edge and associating vertices and edges is useful there are other potential representations for graphs for instancea twodimensional matrix could be used to represent edges between vertices the rows and columns of the matrix represent the vertices the weight of an edge from vertex vi to vertex vj would be recorded at matrix[ ][jsuch representation is called an adjacency matrix adjacency matrices tend to be sparsely populated and are not used much in practice due to their wasted space the chosen graph representation depends on the work being done vertices with adjacency information may be enough an edge list is enough for the kruskal' algorithm vertex and edge information is required for dijskstra' algorithm an adjacency matrix may be required for some situations as programmers we need to be mindful about wasted spacealgorithm needsand efficiency of our algorithms and the implications that the choice of data representation has on our programs summary graph notation was covered in this several terms and definitions were given for various types of graphs including weighted and directed graphs the presented three graph theory algorithmsdepth first searchkruskal' algorithmand dijkstra' algorithm through looking at those algorithms we also explored graph representations and their use in these various algorithms after reading this you should know the following graph is composed of vertices and edges graph may be directed or undirected tree is graph where one path exists between any two vertices spanning tree is subset of graph which includes all the vertices in connected graph minimum weighted spanning tree is found by running kruskal' algorithm dijkstra' algorithm finds the minimum cost of reaching all vertices in graph from given source vertex choosing graph representation depends on the work to be done this copy belongs to 'acha