Simple graph implementation in C