×

To be able to write in the forum you need to authenticate. Meanwhile it's read-only.

Algorithm in script 5223 not working properly

Algorithm in script 5223 not working properly
October 27, 2023 03:32AM
I tried to use 5223 script ("Matrix with different counties (english version)") for a new checker without any additional requirements (empty conf, just {}). Checker says I'm missing one county/DT but I can clearly see how it's not true.

Checker (https://project-gc.com/Challenges//79439) says that I'm missing a county for 2/4.5
At 4.5/1 I have Uckermark, a county in which I have both 4.5/1 and 2/4.5 caches (GC7115H, GC9QE5A)
In Łódź county I have found 4.5/1 cache (GC9JJW0) and this county isn't used for any DT in the result shown by the checker

An obvious solution is moving Uckermark county to 2/4.5 and putting Łódź county at 4.5/1 which would complete this challenge requirement but the checker doesn't see it.
I've read the script and if I understand it correctly it looks like it's just a greedy algorithm trying to fit each county (sorted by the number of different DTs found in it) into the highest available T and then D which results in a chance of failing to find the right solution... or am I wrong?
Re: Algorithm in script 5223 not working properly
October 27, 2023 03:38AM
It appears to be greedy. It is best to reach out to the scriptwriter, vogelbird (though I am sure they will see this when they wake up tomorrow morning.)

My script "Bipartite matching (Depth-first search)" #10562 will correctly handle this, although I'd probably need to add a new function to the script to allow string concatenation to merge D/T into a single key. I can do that if you like. But it wouldn't output very nicely so maybe it's not worth it.
Re: Algorithm in script 5223 not working properly
October 27, 2023 04:03AM
It looks like vogelbird only translated it from a different language.
On one hand, I'm surprised that there are 7 challenge checkers running on this script for a few years already and no one realized it but on the other one it is almost impossible to check it by hand so it required a pretty specific situation to realize that there is a problem (a person close to finishing it and trying to do so not by finding the DTs shown as missing in new counties but by finding DTs already accounted for to move counties).
I've actually tried to find another script capable of checking it and it looked like script 193 could work (it's used to do it with attributes instead of counties) but it times out.
If you would update your script I would be more than happy to utilize this functionality when the time comes to publish this challenge (it's gonna be a part of a longer series so probably next year). And about the look of output... Definitely a downside but after all beggars can't be choosers :)
Re: Algorithm in script 5223 not working properly
October 27, 2023 09:40AM
Sorry but the original script is made by king-ton please contact him
Re: Algorithm in script 5223 not working properly
April 19, 2024 07:57PM
@Hügh The time has come - challenge will by published during local mega-event in July so I've returned to the topic. Actually... Would you mind if I made an extended version myself? I wanted to take a peek into the code and got it working quicker than expected. If so I could deal with modifying the specified output without wasting your time :)
Re: Algorithm in script 5223 not working properly
April 19, 2024 08:15PM
You're welcome to make a fork. Actually, if you tell me the new script number I can merge your changes back into this script. Up to you.
Re: Algorithm in script 5223 not working properly
April 20, 2024 12:19AM
If you're satisfied with the code quality you can surely merge it. Script id is #12513 and I've finished everything I wanted to add. You can check the output by using my geocaching name with configuration: { "min": 81, "key_1": { "field": "DT" }, "key_2": { "field": "county" } }
Re: Algorithm in script 5223 not working properly
April 29, 2024 01:33AM
Sorry, was busy finishing exams. It's merged now. Thank you!
Sorry, only registered users may post in this forum.

Click here to login