Go to file
Malar Kannan 27d7cae28a ported to python3 2017-07-03 17:29:37 +05:30
.gitignore moved loop detection to cyclic_utils 2017-07-03 17:07:28 +05:30
README.md models created 2017-06-30 09:12:34 +05:30
contracts.txt added longest path detection 2017-07-03 17:02:04 +05:30
contracts_partial.txt added longest path detection 2017-07-03 17:02:04 +05:30
contracts_test.txt added loop detection 2017-07-03 08:46:10 +05:30
cyclic_contracts.py ported to python3 2017-07-03 17:29:37 +05:30
cyclic_contracts_test.py added tests 2017-07-03 17:19:51 +05:30
cyclic_utils.py ported to python3 2017-07-03 17:29:37 +05:30

README.md

Problem statement: Suppose a transporter is having 'n' contract; each contract having 'm' routes in which transporter had to provide vehicles.

The problem is to identify the cyclicity in contracts, for eg., if contract-1 is for route city1-city2 then find a return contract from city2-city1; it's possible that vehicle might ply from city2-city3 then look for a contract for city3-city1.

Eventually, it should lead to no. of vehicles coming into the city with load = no. of vehicles going out of the city with load, and all vehicles completing cycle (reaching its original source city).

From the list of given contracts, cyclicity may not be possible. The number of contracts going into the city may not equal the number of contracts coming out of the city. The problem output should identify contract/corridors for which return contract is required and the number of contracts required.

Note: Cyclicity chain should not be more than 3 or 4 cities at max. Loads provided by different contract at different city should be taken as a variable as it would be different for different city & contract.