1 kyu
Optimal Transportation
Loading description...
Algorithms
Mathematics
Performance
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
help help help help help help
This comment has been hidden.
Fixed.
Is it known transportation task problem with known solution, what does not work always, or else you may invent some approximate solution, but it will require longer time. Lets see :D
Absolute brilliant bit 'o' code the kids had fun completing this one
scipy
should be disabled.Number of
Performance tests
should be increased.Fixed and approved as 1kyu.
completely agree with you congrats on the 2 dan! one day youll be like me 8kyu the best of the best
Thank you.
And when that day comes: ;)
This comment has been hidden.
This comment has been hidden.
Maybe it would be better to add the range limits of
suppliers[i]
,consumers[j]
andcosts[i][j]
in the description, some algorithm may be sensitive to this.Added.
This comment has been hidden.
No, high efficiency is a requirement, and I will not change the tests to allow slow code to pass.
In case you still wish to try solving it:
< 500ms
) but you can't even pass themThis comment has been hidden.
Will it always be closed(balanced) type of transport optimization task or not? Should i check the type of task and add supplier or consumer in dependency to the deficiency between total sums of consumers demands and suppliers production?
No, you will never need to add a supplier/consumer.
Oh, sorry, just missed it. But it can be a real addition to this kata(unbalanced type). It'll be a little bit harder.
Thanks for the answer.
I thought about it at first, but converting the unbalanced problem into a balanced one is a trivial task programming-wise, so I did not include it.
In my opinion, linking the transportation problem would be an interesting modification. Also, you could add some explained examples. This is an interesting problem, but I think it is slightly underspecified.
Cheers :)
Added an example to the description. As of the link you provided, I don't want to add it. Firstly, because this is a well known math problem, and the users can find info about it easily even without any exact pointers (I got the wikipedia article as the first link by googling the name of the kata). Secondly, this article only explains the theory behind the problem, and includes lots of obscure math stuff, so I doubt anybody will benefit from reading it.
is that even a "description"...? I doubt it... :/
No explanations? What does the cost mean? per transportation? per goods? What does the matrix mean? What do rows and cols stand for?
This is a (classic) mathematical/optimization problem, so I kept the explanation to the minimum. Also, I know what all this stuff means, so I can't tell for sure what might be unclear to a person who has never heard of such thing.
The description says: "the matrix of supplier-to-consumer transportation costs". This means
costs[i][j]
is the cost of transporting 1 unit of something fromsuppliers[i]
toconsumers[j]
.just... LOL XD
Your last sentence needs to be in the description. The user isn't in your head.