move graph definitions to header file