2 Pages

Assignment6_OverTheRiver

Course: CMS 15200, Fall 2009
School: University of Texas
Rating:
 
 
 
 
 

Word Count: 823

Document Preview

to Introduction Computer Science II Program #6: Over the river ... Due: Wednesday, March 5th, 2008 at 9PM Write a C program to find the least cost path through a scene. Scenes, Cells, and Paths A scene is an N xN grid in which grid cells represent grass, highways, fences, rivers, and swamps. Each cell Ci,j is connected to its grid neighbors. Cell C1,1 is the start cell and cell CN,N is the final cell. There is a...

Register Now

Unformatted Document Excerpt

Coursehero >> Texas >> University of Texas >> CMS 15200

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
to Introduction Computer Science II Program #6: Over the river ... Due: Wednesday, March 5th, 2008 at 9PM Write a C program to find the least cost path through a scene. Scenes, Cells, and Paths A scene is an N xN grid in which grid cells represent grass, highways, fences, rivers, and swamps. Each cell Ci,j is connected to its grid neighbors. Cell C1,1 is the start cell and cell CN,N is the final cell. There is a path from cell Ci,j Ck,l if Ci,j and Ck,l are neighbors, or if there exists a cell Ci ,j , such that Ci,j and Ci ,j are neighbors and there is a path from Ci ,j Ck,l . The starting path contains exactly one cell: C1,1 , the starting cell. A final path is a path from the starting cell to the final cell (C1,1 CN,N ). Each cell type (highway, etc) has a cost associated with it. The cost of a path is the sum of the cost of the cells along the path. Our goal is to compute the least cost path from the start cell C1,1 and the final cell CN,N . A search algorithm In CS 151, you learned about depth first search (DFS). In a recursive implementation of DFS, the recursion stack keeps track of partially constructed paths. DFS is a fine algorithm for finding a path through a scene, but not for our goal of finding the least cost path through the scene. In this assignment, you will use the A or best-first graph search algorithm to find the least cost path through the scene. Instead of using the recursion stack to keep track of partially explored path, A uses a priority queue. The algorithm has the following form: create a priority queue, insert the starting path into the queue. Then, remove the path, Ci,j Ck,l with the lowest priority from the queue. For each neighbor Ck ,l of Ck,l add the path Ci,j Ck,l Ck ,l to the priority queue. Continue this process until the priority queue is empty or a final path is encountered. A uses a distance-plus-cost heuristic for computing priorities. For our application, the priority function, f (p), computes the cost of the path p plus an estimate of the cost of extending p to CN,N . The Manhattan distance, d, between two cells, Ci,j and Ck,l measures the distance between them following a "grid-like" path. Specifically, d = |k - i| + |l - j| This distance from Ck,l , the last cell on to p, CN,N would be a reasonable estimate of the cost. A better estimate would weight the this distance with the cell cost for highways, the least cost cell type. Given an appropriate priority function, the search space can be reduced further by avoiding cycles in paths. In our application, we can detect cycles by keeping track of the cells that have been visited. Data structures: We have implemented a data structure for scenes, including the code necessary to read a scene from a file. This code can be found in: /home/amr/152/scene.{c,h}. You may not change this code. You must implement a path data structure, a priority queue for tracking paths, a hash table for tracking visited cells, and the search algorithm. The scene implementation provides a mechanism for tracking whether a cell has been visited, but this mechanism is provided for testing purposes only. Input and Output: The input format for scenes is: N Row 0 Row 1 ... Row N where N is the size of the scene and a row is a string of N characters drawn from the set {g, G, h, H, f, F, r, R, s, S}. You can find sample scenes in /home/amr/152/p6. Your program should output a list of cells that constitute a least-cost path or "No path found," if no such path exists. Extra credit: use FTG to produce a graphical representation of the solution. Submission: Your program will be...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

University of Texas - CMS - 15200
Introduction to Computer Science II Program #7: City Construction Due: Wednesday, March 12, 2008 at 9PMGraphs are applied widely today in various fields of science and technology. The following is an application example of graphs in everyday life. C
University of Texas - CMS - 15200
CMSC 15200: Introduction to Computer Science IIClass Meet: Tuesday and Thursday 12:00-1:20 PM @ Ryerson 251 Lab Meet: Tuesday 4:30-5:50PM @ JRL A01C Instructor: Kui Ren Office: 275-B Ryerson Hall Phone: (773) 702 3768 Email: kren@uchicago.edu Office
University of Texas - CMS - 15200
/* Depth first traversal */ void DepthFirst(Graph G, void(*Visit)(Vertex) { bool visited[MAXVERTEX]; Vertex v; for (all v in G) visited[v]=false; for (all v in G) if (!visited[v]) Traverse(v,Visit) }void Traverse(Vertex v, void(*Visit)(Vertex) { Ve
Harvey Mudd College - CS - 121
Heroes of CIS: User's GuideCal Pierog February 18, 20041OverviewIn Heroes of CIS, you are the intrepid CIS staffer charged with keeping the academic printers running smoothly. In each level, you are assigned to a lab and must keep all the prin
Westminster PA - ECO - 360
Lecture 22 Eco 360: International Economics Review of exchange rates What is money? And why do we need it? Money supply Money demand Equilibrium interest rate Interest rate and money supply Interest rate and outputReview: Exchange rates Can
Harvey Mudd College - CS - 121
202 0 01 1 1-1 0 00-2 0 01 1 11 0 00
Harvey Mudd College - CS - 121
116 9 31 1 1-1 -1.5 -.50-3 -6 -9.5 1 1.510
Harvey Mudd College - CS - 121
4410 0 01 1 1-1 0 0015 0 01 1 1-3 0 000 15 01 1 10 -3 000 0 101 1 10 0 -10-15 0 03 0 010-10 0 01 0 0100 0 150 0 -3100 10 00 -1 010
Harvey Mudd College - CS - 121
* Print Queue - Importance - Print queue requires a timer and a meter. Neither of which are built in, leading us to be suspicious of how easy they are to implement. Also, as it is the indicator of the game state, it is critical to our gameplay.-
North Texas - CSE - 1040
Bodensteiner BYE Bokshi BYE BrandonDeluca Garcia Deane BYE Griffith BYE Hagar BYE Hall Kubi Javelli BYE Mascarenhas BYE Ponce BYE Schlueter BYE Sneed Valle Sorrells BYE Stoker BYE Stone BYE Wasserman BYEBodensteiner Bokshi Bodensteiner Deane Brando
Harvey Mudd College - CS - 121
Heroes of CIS: Design DocumentCal Pierog, Ryan Riegel, Paul Scott February 9, 20041Concept OverviewIts a frantic night in the Mudd computing labs, and one brave soul is charged with keeping the printers running smoothly. The player takes the r
Sanford-Brown Institute - CS - 250
Algorithms for Planar Graphs Lecture 20: Tamaki's TheoremPhilip N. Klein April 16, 20091Euler characteristicLet n, m, and be the number of vertices, edges, and faces of an embedded graph. The Euler characteristic of the embedding is n - m + .
San Diego State - ART - 496
ALEXANDER CALDER IN FOCUS July 28, 2007March 1, 2009E x hi b iti o n View Calders mobiles, stabiles, drawings and paintings in this small exhibition. These works, dating from 1927 to 1968, demonstrate the artists development throughout his 50 year
San Diego State - ART - 496
MCACIN FOCUSALEXANDER CALDER July 28, 2007March 1, 2009 View Calder's mobiles, stabiles, drawings and paintings in this small exhibition. These works, dating from 1927 to 1968, demonstrate the artist's development throughout his 50 year career. Ca
Wisc Stout - LIB - 1975
UMKC - BDS - 308
BDS 308 MW ClassesTentative ScheduleM W M W M W M W M W M W M W M W M W M W M W M M W M W M W M W 8-Jan 10-Jan 15-Jan 17-Jan 22-Jan 24-Jan 29-Jan 31-Jan 5-Feb 7-Feb 12-Feb 14-Feb 19-Feb 21-Feb 26-Feb 28-Feb 5-Mar 7-Mar 12-Mar 14-Mar 19-Mar 21-Mar 2
UMKC - BDS - 308
BDS 308 TR ClassesTentative ScheduleT R T R T R T R T R T R T R T R T R T R T R T T R T R T R T R9-Jan 11-Jan 16-Jan 18-Jan 23-Jan 25-Jan 30-Jan 1-Feb 6-Feb 8-Feb 13-Feb 15-Feb 20-Feb 22-Feb 27-Feb 1-Mar 6-Mar 8-Mar 13-Mar 15-Mar 20-Mar 22-Mar 2
UMKC - BDS - 330
Chapter 2 Introduction to Linear Programmings s s s s s s sLinear Programming Problem Problem Formulation A Maximization Problem Graphical Solution Procedure Extreme Points and the Optimal Solution Computer Solutions A Minimization Problem Special
UMKC - BDS - 330
Chapter 4 Linear Programming Applicationss s s s s sBlending Problem Portfolio Planning Problem Product Mix Problem Transportation Problem Data Envelopment Analysis Revenue Management 2005 Thomson/SouthWestern Slide 1Blending
UMKC - BDS - 330
946953328722ba818a48d01c7041e7560d04134f.xlsDavis McKeown Hotel Expansion Problem Data Square Footage Building Cost Goal Constraints Actual Amount + Under - Over = Goal Target Value Small 400 $18,000 Small 5 0 0 5 5 Medium 750 $33,000 Medium 10 0 0
UMKC - BDS - 330
Homework One Solutions1.If you set total pages = 1800 A=1000 pgs. S=800 pgs. Zmax= 13,600 rating points If you set total pages>= 1800 A=400 pgs. S=1800 pgs. Zmax= 15,800 rating points2.N = $500 R = $1500 Zmas = 145,000 index points S = $140,0
UMKC - BDS - 330
A 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22BCDEM&D ChemicalsProduct A Processing Time (hours) Production Cost Minimum Total Production Product A Minimum 2 $2.00 350 125 Product B Time Available 1 600 $3.00ModelDecision Va
UMKC - BDS - 330
A 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31BCDEFGJanders Make-or-BuyComponent Base Fin. Cart. Tech. Cart. Fin. Top Tech.Top Cost per Unit Mfg. Time Make Buy in Minutes $0.50 $0.60 1.0 $3.75 $4.
UMKC - BDS - 330
A 1BCDEFGCounty HospitalHospital General University County 285.20 162.30 275.70 123.80 128.70 348.50 106.72 64.21 104.10 Hospital General University County 48.14 34.62 36.72 43.10 27.11 45.98 253 148 175 41 27 23 State 210.40 154.10 10
UMKC - BDS - 330
A 1 2 3 4 5 6 7 8 9 10BCDEFGHIRelax-and-Enjoy Lake Development CorporationDTV 1000 1500 15 65 ETV 2000 3000 10 90 Media DN 1500 400 25 40 SN 2500 1000 4 60 R 300 100 30 20 Min Cust Rch Min TV Ads. Max TV Budget Budget 50000 10 1800
UMKC - BDS - 330
A 1BCDEFGHIJKLGrand Strand BlendingRegular Max Comp 1 30% Max Comp 3 20% Min Comp 2 40% 3 0.84 10000 Premium Min Comp 1 25% Min Comp 3 30% Max Comp 2 40%2 3 Sales Price 4 Regular 1.00 5 Premium 1.08 6 7 Component 8 1 2 9 Co
UMKC - BDS - 330
MSI Market SurveyTotal Interviews Required Minimum with Children Minimum without Children Min Eve. with Children Min Eve. without Children1000 400 400 40% 60%Household Children Day Children Evening No Children Day No Children EveningInterview
UMKC - BDS - 330
A 1BCDEFGHIJMcCormick Manufacturing Company2 3 Labor Hrs. per Unit 4 Dept. P1 P2 Hrs. Avail. 5 1 0.65 0.95 6500.00 6 2 0.45 0.85 6000.00 7 3 1.00 0.70 7000.00 8 4 0.15 0.30 1400.00 9 10 Profit/Unit 10.00 9.00 11 12 13 14 15 16 1
Virginia Tech - CS - 2504
CS2504, Spring'2007 Dimitris NikolopoulosCS2504: Computer OrganizationLecture 1: Welcome to CS2504 Instructor: Dimitris Nikolopoulos ( )CS2504, Spring'2007 Dimitris NikolopoulosAdministriviaInstructor: Dimitris Nikolopoulos Office hour
Virginia Tech - CS - 2504
CS2504, Spring'2007 Dimitris NikolopoulosCS2504: Computer OrganizationLecture 1: Welcome to CS2504 Instructor: Dimitris Nikolopoulos ( )CS2504, Spring'2007 Dimitris NikolopoulosAdministriviaInstructor: Dimitris Nikolopoulos- - -Office h
Virginia Tech - CS - 2504
CS2504, Spring'2007 Dimitris NikolopoulosCS2504: Computer OrganizationLecture 2: Instruction Set Architecture (Programming the Bare Hardware) Instructor: Dimitris Nikolopoulos1CS2504, Spring'2007 Dimitris NikolopoulosAdministriviaHomewor
Virginia Tech - CS - 2504
CS2504, Spring'2007 Dimitris NikolopoulosCS2504: Computer OrganizationLecture 5: Processor Datapath and Control Dimitris NikolopoulosCS2504, Spring'2007 Dimitris NikolopoulosImplement MIPSWe will look into the implementation of:- - -Mem
Mt. Holyoke - ASOL - 836
-11.2115218-11.1656217-11.1198222-11.0739214-11.0281202-10.9822208-10.9364216-10.8905208-10.8447202-10.7988217-10.7530224-10.7071216-10.6612208-10.6154194-10.5695180-10.5237174-10.4778180-10.4320194-10.3861211-10
Georgia Tech - CS - 3500
CS 3500B Homework 121. 36.5-5 2. 36.5-6 3. 36.5-7 4. 36-1
Mt. Holyoke - IZ - 225
Axinite IZ-225 Tolga Oyman 42mg 512 0 0 0 5 0 0 0 0 0 0.000000E+00 295.000 4.153389E+06 6.550599E+06 511.253
Bowling Green - MBA - 8011
The Choice PhaseD e c is io n S c ie n c e F o u n d a t io n s I n t e llig e n c e P hase Q u a lit a t iv e M e th o d Q u a n t it a t iv e M e th o d s D e s ig n P hase U n d e r s t a n d in g t h e R e la t io n s C h o ic e P h a s eD e c
Bowling Green - MBA - 8011
Here are the solutions to problems 2 - 8. You should try to solve them all yourself first based upon the solutions in your notes, the lectures, and the book.2) Given the following payoff table for three alternative investments , A, B and C, under tw
Bowling Green - MBA - 8011
The Design PhaseD e c is io n S c ie n c e F o u n d a t io n s I n t e llig e n c e P hase Q u a lit a t iv e M e th o d Q u a n t it a t iv e M e th o d s D e s ig n P hase C h o ic e P h a s eU n d e r s t a n d in g t h e R e la t io n sU n
Bowling Green - MBA - 8011
1995-DIA-10Fernbank Natural History Museum (A)As frequently happens in the world of business cases. Late afternoon storm clouds were forming to the north over Emory University as Colette Davis gazed across the vast rotunda of the Fernbank Natural
Bowling Green - MBA - 8011
Period PERIODUNITS DEMANDED PER 3 - PERIOD MOVING AVERAGE 1 50 2 60 60 3 70 60 4 50 66.67 5 80 80 6 110Quarter 1 2 3 4 5 6 7 8Students Enrolled in Management Forecast Exponential Smoothed Science 400 400 450 400 ALPHA= 0.2 350 410 420 398 500 4
Bowling Green - MBA - 8011
No Test 1 0 00.5 Bid Wins 1 0 0Test Bid $250k 0 0 0 00.5 Bid Looses 0 0No Test 1 0 00.5 Bid Wins 1 0 0Test Bid $500k 1 0 0 0 0 00.5 Bid Looses 0 0No Test 1 0 00.5 Bid Wins 1 0 0Test Bid $750k 0 0 0 00.5 Bid Looses 0 00.33 Majo
Bowling Green - MBA - 8011
Unit 1, Problem 180,000 = 2U + 80,000U -1 U TC = U + 200 TR = 2U + {100 U 1000} = TR - TC = 2U + 80,000U -1 - (U + 200) = U + 80000U -1 - 200 d = 1 - 80,000U - 2 dU d 2 = 160,000U -3 , Pos Min 2 dUWe want to Max Profit, not Min, so try U=100,
Bowling Green - MBA - 8011
DCS3120 Problem 1 Units 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 850 900 950 1000 TR $1,000 $833 $800 $820 $867 $929 $1,000 $1,078 $1,160 $1,245 $1,333 $1,423 $1,514 $1,607 $1,700 $1,794 $1,889 $1,984 $2,080Unit 1H. LeeTC $30
Bowling Green - MBA - 8011
Comprehensive ProjectThere an Excel Workbook called "econdata.xls" which has several spreadsheets. The first one contains a number of economic time series: 1. Consumer Price Index (CPI) 2. Producer Price Index All Commodities (PPI) 3. 6 Month T-Bi
Bowling Green - MBA - 8011
Gender 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0Months Salary (000's) 39 $48.0 80 $63.5 6 $37.2 7 $33.2 45 $49.1 27 $42.7 36 $46.7 67 $56.9 80 $38.5 65 $38.8 12 $22.5 24 $29.7 5 $20.4 45 $34.0 38 $31.2 54 $41.1SST70.7 571.5 5.7 40.9 90.4 9.6 50.5 299.5 1.
Bowling Green - MBA - 8011
MonthJan-04 Feb-04 Mar-04 Apr-04 May-04 Jun-04 Jul-04 Aug-04 Sep-04 Oct-04 Nov-04 Dec-04 Jan-05 Feb-05 Mar-05 Apr-05 May-05 Jun-05 Jul-05 Aug-05 Sep-05 Oct-05 Nov-05 Dec-05 Jan-06 Feb-06 Mar-06 Apr-06 May-06 Jun-06 Jul-06 Aug-06 Sep-06 Oct-06 Nov-06
Bowling Green - MBA - 8011
ROGETCAL.XLSAttendanceNo Busch, no MARTA Busch, no MARTA MARTA, no Busch MARTA and Busch MARTA helps by Busch helps by Cold Dry helps by Warm Wet helps by Cold Wet 25,000 30,000 35,000 42,000 40% 20% Cold Dry 27,500 33,000 30,250 36,300 10% 20% 10
Georgia Tech - CS - 2200
CS 2200 Presentation 4Datapath and Controldrum roll.Introducing theLC-2002 Instruction SetType Mnemonic Op Code R add nand 0000 0001Function RD RA + RB RD ~(RA & RB)1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4
Bowling Green - MBA - 8011
Freq Table Day Shift Night Shift TotalCorrect0Incorrect 355 298 653Total 2500 1500 4000Correct Day Shift Night Shift Total Day Shift Night Shift Total Correct 2145 1202 3347 Correct 0.536 0.301 0.837 Correct Day Shift Night Shift Total If I
Bowling Green - MBA - 8011
Binomial Probabilityn x p Combinations Probability 6 5 0.4 6 0.04 n n-x 1-p Combinations Probability 6 1 0.6 6 0.04So, out of n trials, the probability of x successes at probability p is equal to the probability of ( n - x ) successes at probabili
Bowling Green - MBA - 8011
Classification 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5Age 30 27 27 29 22 25 24 28 38 29 29 29 23 26 30 27 27 28 32 31 26 28 35 26 29 24 25 26 24 27 28 22 26 27 28 25 24 23 24 27 26 23
Bowling Green - MBA - 8011
Region ATLANTA BRMHM CHAR JACK NO ORLANDO MIAMI WASH BALT DALLAS HOUSTON AUSTINAdv - Last Qtr (0000) Mean Sales Exp Competitive? Rel. Price13 28 17 8 16 18 21 6 25 32 11 16 3 15 20 1 23 4 19 25 7 11 2 20 1 0 1 1 1 0 0 1 0 0 1 1 1.50 0.60 1.00 1.75
Bowling Green - MBA - 8011
Date 2-Jan-96 3-Jan-96 4-Jan-96 5-Jan-96 8-Jan-96 9-Jan-96 10-Jan-96 11-Jan-96 12-Jan-96 15-Jan-96 16-Jan-96 17-Jan-96 18-Jan-96 19-Jan-96 22-Jan-96 23-Jan-96 24-Jan-96 25-Jan-96 26-Jan-96 29-Jan-96 30-Jan-96 31-Jan-96 1-Feb-96 2-Feb-96 5-Feb-96 6-Fe
Georgia Tech - CS - 8803
CS 8803D Course Reading Summaries Paper #: 12 Title: Mercator: A scalable, extensible web crawler (1) Problems: This paper addresses the scalability issue of a web crawler. There are anumber of stages in the crawling process: Storing a list of
Georgia Tech - CS - 8803
CS8803D Course Reading SummariesPaper #: 12Title : Mercator: A Scalable, Extensible Web Crawler.(1) Problems : Design and implementation of scalable and extensible webcrawler.(2) New Ideas/Strengths : The authors present various de
San Diego State - ART - 496
JJYYYYJJ JJJJGoudyB BGG GG G G BB G GType FamilyofB BGG GG G G BB G GJJJJJJGoudy Catalogue Goudy Modern Goudy Modern Italic Goudy Old Style Goudy Sans Goudy Italic Goudy Lombardic Capitals Goudy HandtooledGoudy, Frederic
Toledo - AST - 101
A Universe of Matter and EnergyMatterFeynmans question:If, in some cataclysm, all of scientic knowledge were to be destroyed, and only one sentence passed on to the next generation of creatures, what statement would convey the most information in
Toledo - AST - 101
LightWhy do we need to understand Light?In astronomy, LIGHT is the only way we get information about whats happening in the Universe. Astronomers are passive observers of what is going on. Light is the messenger. We need to understand it.What i
Toledo - AST - 101
More LightWhat it tells usReminder: MIDTERM ON OCT 16Recap Key Concepts Light is a wave A wave is a traveling shape in a material. The shape moves, but the material doesnt. (Remember our in-class wave). The distance between peaks of wave is t
Toledo - AST - 101
Midterm RoomsLast name begins with: Go to this Building/Room:A-Ce: Ch-J: K-Lam: Lan-Raz: Re-She: Shi-V: W-X: Y-Z:EX 320 EX 200 EX 310 EX 100 SF 2202 SF 3201 SF 3202 EX 300EX: Examination Facility (Central Exams Facility) SF: Sandford Fleming B
Toledo - AST - 101
AnnouncementsMake-up midterm for those with medical absences is TONIGHT (see website for more info)For midterm Hand back, Tuesday 1.10pm: last name room A-K MP102 L-Z MP 203Today's Big Question Given their similarities, why is one world heaven a