wu :: forums
« wu :: forums - Finding minimum number of pen lifts required »

Welcome, Guest. Please Login or Register.
May 14th, 2024, 11:06pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: SMQ, william wu, Grimbal, ThudnBlunder, towr, Icarus, Eigenray)
   Finding minimum number of pen lifts required
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Finding minimum number of pen lifts required  (Read 2058 times)
singhar
Newbie
*





   


Posts: 22
Finding minimum number of pen lifts required  
« on: Jul 21st, 2011, 11:08am »
Quote Quote Modify Modify

We have to draw a diagram that consists of several line segments. We are given the start and end coordinates of these line segements. Now we need to find what is the minimum number of times one needs to lift his pen to draw the entire diagram. If needed one is allowed to split a give line segment into two collinear pieces.
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: Finding minimum number of pen lifts required  
« Reply #1 on: Jul 21st, 2011, 1:11pm »
Quote Quote Modify Modify

Split the graph in connected components
For each component count the number of nodes where there's an odd number of ingoing/outgoing connections.  
And I think if you divide that by two, and add one for each connected component without nodes with odd parity you're done.
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
singhar
Newbie
*





   


Posts: 22
Re: Finding minimum number of pen lifts required  
« Reply #2 on: Jul 21st, 2011, 2:35pm »
Quote Quote Modify Modify

This one is going to be an undirected unweighted graph. Could you elaborate your approach a bit more.  
 
I was thinking of the following:
 
Find the largest eulerian subgraph Gsub and then drop all the edges of Gsub from the original graph G and repeat the process. Each eulerian sub graph will give a path between pen lifts.
 
 
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: Finding minimum number of pen lifts required  
« Reply #3 on: Jul 21st, 2011, 10:09pm »
Quote Quote Modify Modify

It's basically the same approach, but without explicitly finding the eulerian subgraphs. You know there's a eulerian trail in a connected component if there are at most two vertices with an odd number of edges. My reasoning is that for every additional pair of vertices with an odd number of edges you can split the connected component in two (by splitting specific nodes in two), such that one component has only two vertices with an odd number of edges (and thus a Eulerian trail).
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board