ps4n2

# ps4n2 - 2 The problem space is basically just a mesh of...

This preview shows pages 1–2. Sign up to view the full content.

2. The problem space is basically just a mesh of vertices that is only connected to 4 adjacent neighbors, and we’re trying to find a local minimum (a vertex n whose value is lower than all 4 of its neighbors) in this mesh. Algorithm : We begin by considering two cases: 1. We look at the 4*n vertices on the border of the chessboard and probe the neighbors of each vertex to find if any are local minimums. If there are, return immediately. 2. We now look at the subproblem where we are guaranteed that the border does not contain an optimum. We can try to divide the problem into 4 quadrants and check one, but we have to first ensure that the borders of those 4 quadrants do not contain an optimum. Since the main border is presumably checked by the precondition of this subproblem in the previous instance, we now only need to check the middle row and column (cross) to check the rest of the border of the quadrants. Since there are 2*n vertices to consider, this is still linear.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

ps4n2 - 2 The problem space is basically just a mesh of...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online