Server-side: graph implementation