HW057
Math 2984 - Fall 2017
Intro to Mathematical Problem Solving


TASK: Using the RISK adjacency matrix, determine the maximum distance from Western Australia to any other region on the game board.


COMMENT: The game board of RISK involves 42 countries, whose connections can be stored in an adjacency matrix A. In our version of the adjacency matrix, Western Australia is region #42.

The game board looks like this:

We define a 42x1 column vector "v0" which is all zero, except that v0(42) = 1. This represents a path that starts at Western Australia.

If we compute v1=A*v0, then v1(i) will be nonzero if it is possible to reach region i from Western Australia in exactly one step. Similarly: setting v2=A*v1, the vector v2 has nonzero entries corresponding to regions reachable in exactly two steps. Since there are 42 countries, and the map is connected, then certainly by the time we reach v41, every region will be visited. Probably, this will happen sooner than 41 steps, though.

We will use the following ideas:


INSTRUCTIONS:

        Copy the file "risk_adj.m" from the homework file directory.

        A = risk_adj ( );  % set the RISK adjacency matrix.

        v = ?;  %Set v to be a 42x1 column vector of zeros.
        Set v(42) to 1.

        steps = ?;  % initialize steps

        
        while ( any ( v == 0 ) )  % repeat until all v is nonzero
          steps = ?;  % increment steps
          v = ?;      % multiply adjacency matrix times v and replace.

        print number of steps

      


CHECK: Your program should report that every region on the RISK board can be reached from Western Autralia in no more than 9 steps. Looking at the map, you can convince yourself of this fact. if you look at the values in v just before the 9th step, you can figure out which countries are the furthest away from Western Australia. A command like "find ( v == 0 )" will report the indices are 6, 8, and 9: Eastern Canada, Eastern US, Central America.


SUBMIT: Your file should be named "hw057.m", and begin with:

        % hw057.m
        % YOUR NAME
        % This script (describe what it does)