fork(1) download
  1. graph_data = {
  2. 1: {"name": "Анализ рынка", "duration": 5, "dependencies": []},
  3. 2: {"name": "Разработка бизнес-планов", "duration": 10, "dependencies": [1]},
  4. 3: {"name": "Юридическая подготовка", "duration": 7, "dependencies": [1]},
  5. 4: {"name": "Формирование команды", "duration": 3, "dependencies": []},
  6. 5: {"name": "Подбор персонала", "duration": 10, "dependencies": [4]},
  7. 6: {"name": "Закупка оборудования", "duration": 5, "dependencies": [4]},
  8. 7: {"name": "Подготовка помещений", "duration": 7, "dependencies": [6]},
  9. 8: {"name": "Маркетинговая кампания", "duration": 5, "dependencies": [2]},
  10. 9: {"name": "Открытие филиалов", "duration": 2, "dependencies": [5, 7, 8, 3]},
  11. 10: {"name": "Мониторинг", "duration": 10, "dependencies": [9]}
  12. }
  13.  
  14. edges = []
  15. for task_id, task_data in graph_data.items():
  16. for dependency in task_data["dependencies"]:
  17. edges.append((dependency, task_id))
  18.  
  19.  
Success #stdin #stdout 0.02s 6920KB
stdin
Standard input is empty
stdout
Standard output is empty