Question: Python - The wording is a bit strange here so I am not sure what it means and how to go about this problem. We
Python - The wording is a bit strange here so I am not sure what it means and how to go about this problem.
We wish to use graph theory in order to solve the following problem. A company should carry different chemical products P1, P2, ..., Pk from the factory to a city. For security reasons, some products should not be carried in the same truck:?i, 0 < i < k, Pi is not compatible with Pi+1. Moreover Pk is not compatible with P1.
1) Write a comment: how can we state an undirected graph that visually represents this problem: 1. What are the vertices, what are the edges? 2. What is the specific property of this graph?
2) Write an algorithm that, given an integer k > 1, returns the minimum number of trucks necessary to carry all the products.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
