Implementation of a graph using two-dimensional linked list