1 / 8

Lab 10 12/1

Lab 10 12/1. Project 2 Grades. Grades rescaled +5 points To a maximum of 105/100. Project 3 Grade Scale. 80: A program that compiles, runs, halts and returns a sensical answer. Sensical: 0 < k < | V |+1 +10 if your wrong answer is reasonable .

doli
Télécharger la présentation

Lab 10 12/1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 1012/1

  2. Project 2 Grades • Grades rescaled • +5 points • To a maximum of 105/100.

  3. Project 3 Grade Scale • 80: A program that compiles, runs, halts and returns a sensical answer. • Sensical: 0 < k < |V|+1 • +10 if your wrong answer is reasonable. • A 30-color coloring of a 20-colorable graph is reasonable. • A 50-color coloring might be too, if there are around 500 vertices. • A 100-color coloring probably wouldn’t be. • +10 if your answer is very close. • Consistantly off by 1-2 • But never *under* the correct answer. • Prof. Cheng’s program gives “very close” answers. • +10 if your answer is correct. • 110/100 • The minimum coloring • Not readily achievable with the assigned algorithm. • -5 points if your program is inefficient. • Takes an extremely long time to halt. • ANDI can find some particularly inefficient code to complain about.

  4. Project 3—Advice for Reading Dimacs Graph Files • Use Adjacency Matrix representation for the graph. • Read each line of the file... • Use a string tokenizer to break up the line into tokens. • Delimited by space ‘ ‘. • If the first token is “c”, ignore the line. • Otherwise if the first token is ‘p’ then the next token is |V| and the third token is |E|. • So make a |V| x |V| matrix gAdj of booleans. • Initialize all values to false.

  5. Project 3—Advice for Reading Dimacs Graph Files • If the first token is “e” then the line represents an edge. • The second token is u and the third token is v. • gAdj[u][v]=true; gAdj[v][u]=true;

  6. Homework 4 • Problem 1 • Hint: Given a set X={x1…xn} and a set of subsets Y={{xa…},{xb…},{xc…}} of that set… • Suppose {xa…} is the minimum member of Y. • Suppose we construct X1 and Y1 by squaring every xi. • Does that change the minimum member of Y? • The Shortest Path case is equivalent to the “Hint” problem. • Why? • The Minimum Spanning Tree case is not. • Why?

  7. Homework 4 • Problem 2 • Given G=(V,E) and T a minimum spanning tree of G. • Consider H=(V,E+{x}) • One edge ({x}) has been added. • Two steps: • Make an O(|E|) or O(|V|) algorithm to determine if T is also a minimum spanning tree of H. • Make an O(|E|) algorithm to construct a minimum spanning tree of H (in the case where T is not such a tree).

  8. Homework 4 • Problem 3 • Dynamic programming • You are given the recursion relation. • C(n,k) = C(n-1,k-1) + C(n-1, k) • Follow the examples given in class.

More Related