AGeek
AGeek

Reputation: 5225

Graph data structure implementation in C

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.

Upvotes: 3

Views: 7937

Answers (2)

bw_0x7c6
bw_0x7c6

Reputation: 17

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.

Upvotes: 1

Alex Martelli
Alex Martelli

Reputation: 881497

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.

Upvotes: 3

Related Questions