Anonymous user
Talk:Transportation problem: Difference between revisions
→Regarding The Java/D Versions: correction
m (→Regarding The Java/D Versions: sp) |
(→Regarding The Java/D Versions: correction) |
||
Line 19:
I have found the function getClosedPath() not easy to understand and semantically a little complex (and bug prone to translate). So can you comment the parts of getClosedPath() to help me write simpler D code, or can you restructure it to make its workings more linear (in D I've used three different 'stones' variables inside it, including a dup-ping)?
: Yes, I was planning to add a comment there, it's not very clear. I think you're supposed to use a breadth-first or depth-first search, but it occurred to me that if you remove all the "stones" that do not have a horizontal AND vertical neighbor (and therefore cannot be corner-stones) you will be left with the stones that form the closed path. (Removing stones is done in a
|