I have learned the basics of graph data structures. Now I want to implement all the structure/algorithms/operations that can be performed on graphs.
Please share some useful links wherein I can get started doing graph implementations in C.
adjacency list and adjacency matrix are the two most classic alternatives for implementing graphs. I'm not sure if there are many examples of each online in C, but here is one for the adjacency matrix representation.
matrix[I][J]=1; insert new vertex N+1 → allocate new N+1 by N+1 matrix and copy the old one over padding with the new row and col of 0s. adj list: in adj matrix: insert edge (between existing vertices I and J) → append J to the adj list of I; insert new vertex → append it to the list of existing vertices.The book,The Algorithm Design Manual[PDF] has C code implementing a graph.
For a more thorough textbook on graphs and related algorithms (DFS, Bellman-Ford etc) Introduction to Algorithms (excellent) has pseudocode implementations that you could implement.
The standard adjacency list or matrix representations mentioned by Alex are described in both.