CS141 Lab 9


Main task for this lab is to finish the In-lab assignment of Lab 8. 
For those studetns who have finished lab 8, we have bonus questions for you !!


Assignment



Bonus Questions

          You can get 1 bonus point if you only show me your idea of the solution, without finishing your code.


            This is problem does not have a polynomial time solution.  But you can come up with heuristics methods (approximation algorithms) ie:
            * Find shorstest path,   if length < k, then try to improve the cost (is there another path with less cost? and still less than K hops)
 
              So the question becomes how can I improve the cost of the current path:
              Again heuristics:
            Question:
                    Will this guarantee the best solution?  
                    Please think of an example if you think that it will not find the asbolutely best solution. 


            Euler's Problem: 
                asks whether there is a path through a graph which traverses each edge only once.
                It can be drawn with a single line or there exists a cycle that passes from every edge exactly once. 
                The problem can be solved polynomially: given the starting point you just need to visit all edges.  

                See: http://ciips.ee.uwa.edu.au/~morris/Year2/PLDS210/hard.html#euler
                (only the first part)

            Questions:
                  How to check whether there exists an Euler cycle or not in a graph, using polynomial running time?
      1.  Suppose the starting point is given
      2.  What you can do if the starting point is not given?