Activity schedueling using graphs