For Strategy B:
How many iterations are we supposed to do?
The number of iterations depends on the number of rows and columns in your map. If you have a MAP with R rows and C columns, then
you will have C-2 columns to choose from, that is you can start at Column 1, Column2, ……, Column (C-2). Column 0, and Column C-1 are the left most and right most columns respectively. They are not considered as inner
Once you selected a column, you have to start a row, and you have R rows to select
Assuming you are Column j, and you are also at row i, you need to build the subpaths:
Starting from MAP[I,j] to MAP[I,0]
Starting from MAP[I,j] to MAP [I, C-1]
Concatenate the two subpaths to form the path that started from the inner location MAP[I,j]
Recall that our ultimate goal is to find the best path that start from an inner location. You have the choice of:
finding all the possible paths that start from any inner column and any inner row. Recoding all these paths, then at the end determine the best path
The second method is to avoid recording all paths that start from any inner column and any inner row. All you need is to record what is the current best path. Then when you select a new different starting location within the same column, you will compare the newly found path, with the “best current” path, and decide whether or not to update what the current best path is. This is a matter of design that you need to decide upon and justify your
Hence, for each column you select, you will have to iterate over all possible row positions. You will be able to determine which is the best path that starts from that column.
You have to iterate the process so that you can start form all possible columns. At the end you will find the “optimal path”
Do we add the 2 subpaths from a starting position and then compare that full path with the other full paths of other starting positions of the same row? Basically, what determines the "best path"?
ex: compare the paths of column 4 and column 9 of the same row (0) to find the best path of row 0?
Where are we starting? At an arbitrary "middle" position or any arbitrary position? Because both of those words are mentioned. Not sure if it's arbitrary or just midpoints?
"starting from an arbitrary middle-position"
"an arbitrary location MAP[x,y]"
For Strategy C:
What do you mean by this: "This strategy may not correspond to the lowest change in elevation from the current location as in the FUD "
so we're not comparing it to the current position? No you are not
if we're not, how are we determining the lowest change in elevation? All you have to do is at every step you look at lowest ekevation within the next column you are going to visit and select the row that holds that
How many iterations are we doing? By reading the clarifications I added, you should answer that
From which position are we starting? you will start from column 0 heading your way to column C-1. In column 0 you select the row with the lowest possible value, and proceed to column 1, find the row with the lowest value in column 1, pick that location, and so on. In summary, when reaching a column j, you will have to select the row of column j that stores the smallest elevation value within column
For Strategy D:
What do you mean by "accessing any subsequent cells until you reach the last column"?
I posted an example with 5 rows and 5 columns. This strategies is the BRUTE FORCE STRATEGY.
You start from Column 0. You can start from row 0, 1,2,3,4.
For each starting position in column 0, you will consider Column 1
When you reach column 1 , you have also 5 possible ways for your path. Each row position you select correspond to a different path
You keep using this procedure until you cover all possible paths that started at anywhere within column 0 and ended up anywhere within column C-1
DescriptionIn this final assignment, the students will demonstrate their ability to apply two majorconstructs of the C programming language – Fu
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of