the graph adt graph is collection of vertices and edges we model the abstraction as combination of three data typesvertexedgeand graph vertex is lightweight object that stores an arbitrary element provided by the user ( an airport code)we assume it supports methodelement)to retrieve the stored element an edge also stores an associated object ( flight numbertravel distancecost)retrieved with the elementmethod in additionwe assume that an edge supports the following methodsendpoints)return tuple (uvsuch that vertex is the origin of the edge and vertex is the destinationfor an undirected graphthe orientation is arbitrary opposite( )assuming vertex is one endpoint of the edge (either origin or destination)return the other endpoint the primary abstraction for graph is the graph adt we presume that graph can be either undirected or directedwith the designation declared upon constructionrecall that mixed graph can be represented as directed graphmodeling edge {uvas pair of directed edges (uvand (vuthe graph adt includes the following methodsvertex count)return the number of vertices of the graph vertices)return an iteration of all the vertices of the graph edge count)return the number of edges of the graph edges)return an iteration of all the edges of the graph get edge( , )return the edge from vertex to vertex vif one existsotherwise return none for an undirected graphthere is no difference between get edge( ,vand get edge( ,udegree(vout=true)for an undirected graphreturn the number of edges incident to vertex for directed graphreturn the number of outgoing (resp incomingedges incident to vertex vas designated by the optional parameter incident edges(vout=true)return an iteration of all edges incident to vertex in the case of directed graphreport outgoing edges by defaultreport incoming edges if the optional parameter is set to false insert vertex( =none)create and return new vertex storing element insert edge(uvx=none)create and return new edge from vertex to vertex vstoring element (none by defaultremove vertex( )remove vertex and all its incident edges from the graph remove edge( )remove edge from the graph