I am supposed to create a weighted directed graph and implement a variety of functions for this graph. Creating a directed graph, Depth first search, Breadth first search, adding edges, removing edges, telling if there is an edge between two vertexes, adding vertexes, removing vertexes, etc. My problem is that in class we were taught how these things worked in theory being drawn on paper, but we were never taught the slightest thing about implementing them.
I am supposed to use a vector to store the vertices in the graph and use the adjacency list representation for edges in the graph.
there is a function called weightedGraph(Costtype none) that is supposed to create a directed graph giving all edges a weight of none.
How do i do this?
also how do i implement the addedge function? it accepts two vertexes (to go from one vertex to the next) and it also accepts a cost for the edge.
please help I am clueless on how to implement this stuff. Any info would help. (helping me conceptualize it or anything)