140 likes | 239 Views
CSU 670 Review. Fall 2008. Software Development. Application area: robotic games based on combinatorial maximization problems. Software development is about collecting enough knowledge about the application area and communicating this knowledge to the machine.
E N D
CSU 670 Review Fall 2008
Software Development • Application area: robotic games based on combinatorial maximization problems. • Software development is about collecting enough knowledge about the application area and communicating this knowledge to the machine. • SOFTWARE DEVELOPMENT requires application experts and design/programming experts. Software developers need to talk the language of application experts.
Our Application Area • Was chosen carefully to learn more about CS core topics: algorithms, complexity, optimization of continuous and discrete functions, discrete mathematics, a bit of game theory.
Application Area: SDG • Classic Specker Derivative Game with potential option to extend for the Secret SDG. • Two interpretations • Trading financial derivatives • Create a new world of organisms in which they need to survive by trading with each other intelligently. (a small model of what humans do.)
SDG game: Classic • Generic version: derivatives, predicates, raw materials, finished products. • Specialized version: choose MAX-CSP as substrate. Predicates choose subsets of MAX-CSP instances. E.g., the MAX-CSP instances that only use (22). raw materials = CSP formulae. finished product = raw material + assignment.
Flow of one match(reusing chess terminology) • The game is a sequence of moves by two players, called White (W) and Black (B). • A move consists of two mini moves: • W offers; B buys or reoffers; if buy, W delivers raw material; B finishes. • the same but W and B swapped. • The number of moves is predetermined. • Winner: most money, gets 1 point. If same amount: draw (½ point).
SDG game: Secret • Generic version: derivatives, predicates, raw materials (hide secret), finished products (attempt to reveal secret). • Specialized version: choose MAX-CSP, or other combinatorial maximization problem, as substrate. Predicates choose subsets of instances. raw materials = instance + quality of secret solution. finished product = raw material + solution “coming close to secret solution”.
Secret SDG Game • About finding subsets of NP-hard maximization problems that can be solved or approximated efficiently. • Predicate of the derivative defines the subset.
Example of secret derivative • 4 coloring of graphs. • As CSP problem: Encode 4 colors with 2 bits. Need one relation of arity 4 and one constraint per edge. • Constraint for edge (x,y): COLOR(x1,x2,y1,y2) = ! ((x1,x2) = (y1,y2)) • Predicate: Graph is planar: can be embedded in plane. • derivative = (COLOR planar, price ??)
Four Color Conjecture(England, middle of 19th century) • Every planar graph can be colored with 4 colors. • Became Four Color Theorem in 1976 by Appel and Haken. • Proof is a simple induction on the number of regions but the induction step requires nearly 2000 complicated cases. Only a computer can check that. • What should the price be for (COLOR planar, price ??)
Another secret example • derivative d = ((22),p) • we know that we can find efficiently a solution that is at least 4/9 the maximum. • derivative d = ((22),4/9) we would buy. • The raw material might now be a satisfiable formula; in a symmetric formula we could achieve the maximum in polynomial time. • Maybe there is a better polynomial approximation algorithm that achieves 4/9 + epsilon of the maximum. An open problem.
Software Development • Complexity of application area: needs to be “interesting” but not too hard; only basic skills should be required. SDG satisfies that. • Interesting application area leads to appropriate challenges for software developers.
Challenges • What are the requirements? • Win at selling and buying derivatives. • Architecture of player and administrator. • Review Pragmatic Programmer Tips • Write Code That Writes Code • Use Assertions to Prevent the Impossible • Configure, Don’t Integrate • Estimate the Order of your Algorithms
More tips • Refactor Early, Refactor Often • Test Your Software, or Your Users Will