- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Nifty assignmentsBrute force and backtracking.ppt
SIGCSE 2003 The puzzle Brute force problem solving Requirements Example Example Oh no! Oh yeah! Additional restrictions Sequence class Problems 8-queens Problems Faster! Faster still! Nifty assignments Nifty assignments Nifty assignments Nifty assignments Nifty assignments Nifty assignments Nifty assignments Nifty assignments Nifty assignments The puzzle Nifty assignments Nifty assignments Challenges: Algorithm analysis: instrumenting the program to keep track of running time and number of calls to the filter and to the backtrack method. Here’s the assignment. One of the things that makes these problems attractive is that the problem is easily specified and easily understood, although the solution is not. Problem solving strategy is brute force Not this. Try all possibilities Run then through a filter Toss away non-solutions; keep the solutions. This guarantees finiteness Assign Sequence class earlier in the semester. That then becomes part of this assignment Fail: dead end or we have exhausted all the possibilities at this point, then backtrack. Backtrack fails: nothing left to undo, algorithm ends. Try each element put it in the sequence generate all possible remaining parts of the sequence. Take it off the sequence 281 trillion Map represented a nxn boolean adjacency matrix. If element I,j is true, region I and j have a common border and must be different colors. Can specify non planer maps. Easy, solution is known length; each element is a color. Harder, length is not known, but is bounded. Easier: Maze like this one has no loops Harder: Maze with loops. Must keep track of where we’ve been to prevent looping. * Nifty assignments:Brute force and backtracking Steve Weiss Department of Computer Science University of North Carolina at Chapel Hill weiss@cs.unc.edu Generate candidates Filter Solutions Trash Candidate set must be finite. Must be an “Oh yeah!” problem. Combination lock 60*60*60 = 216,000 candidates Solution is a seque
您可能关注的文档
- Grammaire – Leçon 13(Bilan).ppt
- Grammatical Filling.ppt
- Grounding of Airfield Lighting.ppt
- Group #18.ppt
- Group 13Heavy Lift Cargo Plane.ppt
- Halogenated Aromatic Hydrocarbons.ppt
- Handout #14.ppt
- Haplotype Blocks.ppt
- HAPTER 16.ppt
- He Has Millions and a New Job at Yahoo. Soon, He'll Be 18..ppt
- No. 13 Spinning Ice.ppt
- Noise Canceling in 1-D Data Presentation #13.ppt
- Norman Jones Senior Engineer13 Jan 2005.ppt
- November 16, 2007.ppt
- NRAO Green BankPolicies for RFI Management.ppt
- Nurses Assuring Quality Care for all Populations.PPT
- Nursing session in APAN 24th.ppt
- Obtaining Venture & Growth CapitalChapter 13.ppt
- October 13, 2006.PPT
- October 13, 2009.ppt
文档评论(0)