Problem 107
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
-
mynameisalreadytaken
- Posts: 20
- Joined: Sun Sep 25, 2011 11:20 pm
-
Fogmeister
- Posts: 27
- Joined: Mon Aug 22, 2011 11:20 am
Re: Problem 107
Cool, thanks, realised that as I was typing the question 
Solved it now though and all on my own. I came up with the algorithm myself and it works in around 15ms
Just looking up the different names and it appears I used a reverse-delete algorithm
Very pleased with this one
Solved it now though and all on my own. I came up with the algorithm myself and it works in around 15ms
Just looking up the different names and it appears I used a reverse-delete algorithm
Very pleased with this one

-
amidar1
- Posts: 8
- Joined: Tue Dec 20, 2011 12:37 am
Re: Problem 107
Can anyone verify some results concerning the network that daniel.is.fischer posted a while ago?
I'm getting an initial weight of 219 and a reduced weight of 119 for his network. Hopefully this is wrong and will help me figure out why I'm not getting the right answer to the problem. (I do get the right answer for the example, though.)
Thanks!
I'm getting an initial weight of 219 and a reduced weight of 119 for his network. Hopefully this is wrong and will help me figure out why I'm not getting the right answer to the problem. (I do get the right answer for the example, though.)
Thanks!
-
thundre
- Posts: 356
- Joined: Sun Mar 27, 2011 10:01 am
Re: Problem 107
That is correct, according to my algorithm. You must have a different problem than the one he was trying to illustrate.amidar1 wrote:Can anyone verify some results concerning the network that daniel.is.fischer posted a while ago?
I'm getting an initial weight of 219 and a reduced weight of 119 for his network.

-
amidar1
- Posts: 8
- Joined: Tue Dec 20, 2011 12:37 am
Re: Problem 107
Oh well, I'll have to dig deeper then. Thanks for confirming the result about the test case.
Cheers
EDIT
Found the "bug." I was reading the question wrong. Very frustrating, but at least I have the answer now.
Cheers
EDIT
Found the "bug." I was reading the question wrong. Very frustrating, but at least I have the answer now.
-
Yfke
- Posts: 2
- Joined: Wed Aug 10, 2011 9:05 pm
Re: Problem 107
I'm really stuck on this one.
I first thought that maybe the algorithm that I came up with was wrong since I just tried it for the example graph and it seemed to work, but then after some googling I found that it had a name and is a 'real' algorithm. As it turns out, I'm using the same one as the Fogmeister (not sure if the name of that algorithm should be posted in this topic though? It's quite a big giveaway).
Anyway, my program runs correctly on the example (returning 150 as the answer) and the extra example posted in this topic (returning 100 as the answer). I am quite sure that it reads the file correctly, as the original sum of the edges is computed as 261832, as verified to be correct in an earlier post here.
The (wrong) answer my program comes up with is a maximum saving of 208399. Does anyone maybe recognize from this answer what my mistake could be? I already tried typing it in three times today, so I'm positive it isn't just a typo or something
Edit: I've run my algorithm on the left 12x12 corner of the given matrix and it returns 17199. Can anyone verify whether this is correct?
I first thought that maybe the algorithm that I came up with was wrong since I just tried it for the example graph and it seemed to work, but then after some googling I found that it had a name and is a 'real' algorithm. As it turns out, I'm using the same one as the Fogmeister (not sure if the name of that algorithm should be posted in this topic though? It's quite a big giveaway).
Anyway, my program runs correctly on the example (returning 150 as the answer) and the extra example posted in this topic (returning 100 as the answer). I am quite sure that it reads the file correctly, as the original sum of the edges is computed as 261832, as verified to be correct in an earlier post here.
The (wrong) answer my program comes up with is a maximum saving of 208399. Does anyone maybe recognize from this answer what my mistake could be? I already tried typing it in three times today, so I'm positive it isn't just a typo or something
Edit: I've run my algorithm on the left 12x12 corner of the given matrix and it returns 17199. Can anyone verify whether this is correct?
- mpiotte
- Administrator
- Posts: 1961
- Joined: Tue May 08, 2012 5:40 pm
- Location: Montréal, Canada
Re: Problem 107
Correct for 12x12.Yfke wrote:...
Edit: I've run my algorithm on the left 12x12 corner of the given matrix and it returns 17199. Can anyone verify whether this is correct?
Last edited by mpiotte on Fri May 17, 2013 1:08 pm, edited 1 time in total.

-
thundre
- Posts: 356
- Joined: Sun Mar 27, 2011 10:01 am
Re: Problem 107
One way to check your algorithm is to count the number of edges that remain. It's very easy to calculate what the final edge count should be.

-
Yfke
- Posts: 2
- Joined: Wed Aug 10, 2011 9:05 pm
Re: Problem 107
Thanks thundre and mpiotte! I have finally been able to identify my problem. Something went wrong when two edges had the same weight, it's just bad luck that I didn't come across that when running my program on the example problems... ah well. Next stop: problem 108 
- yourmaths
- Posts: 47
- Joined: Mon Aug 25, 2014 11:00 am
Re: Problem 107
Indeed. Those of us getting the test answer of 93 are fundamentally misunderstanding the question being asked.amidar1 wrote: Wed May 23, 2012 2:09 am Found the "bug." I was reading the question wrong. Very frustrating, but at least I have the answer now.
level = lambda number_solved: number_solved // 25


