CONPOIN - Editorial

But i won’t choose these points. i would go for 1=(0,0) 2=(1,0) 3=(1,1) and 4=(0,1). So thats a possible way of choosing the points and hence the answer should be “YES” according to me.

Because the question states “whether it’s possible to choose N points on the Euclidean plane in any way such that they will always fit the situation described above.” and YES, it is possible.

1 Like

@miteshag The question asks us to determine whether there exists an embedding such that we can’t draw an extra edge. Yes I agree that this graph isn’t maximal, but there exists a way to embed that graph so that there are no ways to add additional edges, namely a square with one of its diagonals. The problem statement should have mentioned that “regardless of how we place the N points on the plane such that the edges don’t cross, we can’t place a new edge between existing points”, instead of “try to place the N points in a way such that …”.

Its particularly frustrating because I immediately dismissed the idea of just classifying the graph as maximally planar precisely due to the fact that I thought the graph just had have one embedding that was maximal, as the problem statement suggests :frowning:

1 Like

I read it again just now. Now I see that your point is valid.

The problem statement changed to

The question is: whether it's possible to choose N points on the Euclidean plane in any way such that they will always fit the situation described above.
at 14/06/2015, 02:00 hrs IST. But I think it was too late.

I have had my time on this problem because of the misleading and ambiguous explanation. What I initially (and for several days) undertood was whether you can plot the N points in a plane such as no two intersect and adding one more STRAIGHT line would be impossible. There was a lot of red herring in the explanation:

  1. Why do the edges have to be straight? In no way does this change anything about the problem.
  2. What is with this sentence: “The question is: whether it’s possible to choose N points on the Euclidean plane in any way such that they will always fit the situation described above.” ? It has not much sense at all
  3. If the condition has to hold in any circumstance, WHY emphasize on the collinearity of the points? It makes no sense. This one drove me on the wrong track.

Other than that, the problem was nice, and maybe I would have learned the algorithm for this one, if I had undertood it properly sooner.

The problem statement isn’t “misleading”, it’s entirely incorrect however you interpret it.

@ushsh, both the pre-edit and post-edit versions of the problem are wrong. The edit just rewrote the sentence while for the most part maintaining its meaning.

Easy example: for n=4, m=5, the graph can ALWAYS be drawn by choosing (it said you could choose points from the euclidean plane) the 4 points to be the vertices of a square and the 5 edges to be its outer edges and one diagonal, in which case you can never draw the 6th edge, making the answer 1 in this case. Every graph with (4,5) is isomorphic to the graph described in this embedding.

PRE-EDIT VERSION

… He marked N pairwise different points on the plane and then connected M pairs of these points by straight-line segments. None of these segments intersect(maybe except at the initial N points). Then Leha tried to draw the M+1-th segment but surprisingly it turned out that it was impossible to connect any pair of points by straight-line segment which wouldn’t intersect with any of the previous segments.

The questions is: whether it’s possible to choose N points on the Euclidean plane such that they will fit the situation described above.

Yes, it’s possible to choose points as described above. You said “is it possible to choose”. This means you are allowed to choose any planar embedding, even one that would prevent you from adding another edge.


POST-EDIT VERSION

The question is: whether it’s possible to choose N points on the Euclidean plane in any way such that they will always fit the situation described above.

Yes, it is possible to choose points “in any way” (as described above) such that they will “always” fit the situation. “Any way” means “any one way out of all possible ways”. By saying “always”, the author obviously meant to say (as we realized after some WAs), output 1 if

(i) there exists at least one choice of points with a corresponding planar embedding, and

(ii) considering all graphs (>= 0 of them) resulting from an edge addition to the input graph, none of them has a choice of points corresponding to a planar embedding.

That is, is the graph maximal planar. Totally different question.

Making some words in a sentence bold does not change their meaning. Linguistic accuracy is the foundation of making problem statements, as all of mathematics and computer science depend on formal notation and on rigour in language.

I understand that the problem was probably translated from another language, but that definitely does not justify its being incorrect after testing. I know this is a pretty long rant, but I wasted a lot of time on this problem (as I did with the author’s previous problem LPARTY a few months ago, which also had a terrible choice of words and story).

I do hope I am correct and would appreciate it if someone could explain how I am wrong in case I am.

5 Likes

I used almost exactly the approach from the editorial - googled the paper and implemented the algorithm described there.

That’s a bad thing, though. For one, getting to the paper took me about half a minute on Google and 5 minutes of waiting for the login page on Researchgate to load. What’s worse, there’s literally no CS about it, it’s all just implementation and googling; you don’t have to read the paper (apart from the 3 algorithms you’re asked to implement) at all. That’s not how you make contest problems.

Btw “The first part is to find whether it is possible to draw the points and edges such that the edges are non intersecting.” - no, that isn’t required in the solution. From what I understood, the described algorithm is simple exactly because it assumes the graph is maximal planar, and just reports “fail” when the assumption fails instead of trying more sophisticated ways to test if it’s just planar.

Editorial: 0/10 nothing to read.

10 Likes

I agree with @Amlesh. This is the fcking shittiest problem statement I have ever seen in my life. To think I spent days trying the wrong problem when I have so much more important shit to do, darn. You guys do not know how to write problem statements. The question clearly wanted an embedding of a planar graph on the plane such that any new edge intersects a previous segment. Now, it is like, “Hehe, just a misunderstanding, I meant a maximal planar graph. Not a big deal”. I hate you all.

2 Likes

Next time pay please more attention to the problem statement and clarify the updates somehow, otherwise people try to solve another problem which is much more complex.

Could not download paper. Please write normal editorial or give working link.

4 Likes

I attempted the question for 20 marks . This is my solution.

http://www.codechef.com/viewsolution/7154533

It gave WA on the second part of the subtask meant for 20 points.
Now , have a look at this solution,
http://www.codechef.com/viewsolution/7211402

What i can’t understand is that I just used a greater than sign for just namesake (in case there are more than n*(n-1)/2 segments given as the value of m). Afterall , it was specifically mentioned that no two points can be connected by more than 1 segment , and no point can be connected to itself. So, how can this solution of mine can be wrong. Pls, help where am I wrong.

1 Like

@shivamg_isc

Check this :-- CodeChef: Practical coding for everyone

I just changed your soln a little bit…

All >= signs are there as it is except for n = 5 (last case) as 5C2 is 10…

That was your mistake for n = 5 and m = 9 ans is 1 and for n = 5 and m = 10 ans must be 0…

Hope you can understand…

@shivamg_isc , agree with you.
As the problem statement says the given m edges are non-intersecting.
For n=5, and the optimal planar graph will have 9 edges (i.e. we cannot add more edge). Since they are not giving non-intersecting edges they cannot give m>=10 for n=5, so for m<9 answer should be 0 and m>=9 answer should be 1. But it gave me wrong answer. I got correct answer for 20 points when i did m==9 instead of m>=9. Why so, if they haven’t given m>=10 (because for m>=10 the m edges will intersect) ???
I mean answer should not depend for m>=10 for n=5 since they are not giving non-intersecting edges.
Am i wrong anywhere in understanding anything??

@checkmate1 , Yes 5C2 is 10.But they cannot give m=10 for n=5 because for this the edges will intersect but question say the given m edges are non-intersecting. So how they can give m=10 non-intersecting edges for n=5??? So one cannot say whats the answer for m=10 and n=5.

@shubham201
that is what… this is exactly the point which flashed in my mind. It is impossible for them to give m=10 for n=5. Was there some problem with the test cases ? :confused:
This question sucks .

Editorials are supposed to provide an opportunity for us to learn. Not point to a third party link! Wake up guys!

Uploaded the paper (PDF) here: https://www.scribd.com/doc/269955060/A-simple-recognition-of-maximal-planar-graphs

Edit: To clarify why the second point is a big contradiction to what the problem actually asks for:

“whether it’s possible to choose N points in any way(this was in bold)”. Whether it’s possible means that we should analyze whether there is at least one way of doing it, then “any way” messes up the logic. If you really meant looking for a maximal planarity testing, you should have said:

“Whether, for any placement of the N points and M segments such as no two intersect, adding the M+1-th segment would break this property”. This is much clearer and follows the rule of logic.

My interpretation of the statement “The question is: whether it’s possible to choose N points on the Euclidean plane in any way such that they will always fit the situation described above” is that if there is at least one way of choosing points such that it does not conform to the conditions then answer is NO. The highlighted phrases are important. If you choose the points in ANY WAY, and they ALWAYS conform to the conditions, then answer is YES which is what the statement says basically.
IMHO the statement is not ambiguous.

If you choose points in ANY WAY, and they ALWAYS fit the conditions stated (regardless of what points you chose), then answer is 1. (read my comment on @Amlesh’s second answer).

“the graph can ALWAYS be drawn by choosing (it said you could choose points from the euclidean plane) the 4 points to be the vertices of a square and the 5 edges to be its outer edges and one diagonal, in which case you can never draw the 6th edge, making the answer 1 in this case.”

Answer is 0 in this case. In your example, the graph cannot ALWAYS be drawn by choosing the points such that it’s a maximal planar graph