No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Dynamic Programming solver for The bridge crossing problem

3.0 | 1 rating Rate this file 6 Downloads (last 30 days) File Size: 4.89 KB File ID: #21969 Version: 1.0
image thumbnail

Dynamic Programming solver for The bridge crossing problem



The bridge crossing problem is here modelled and solved as undiscounted Dynamic Programming problem.

| Watch this File

File Information

The bridge-crossing problem is a mathematical puzzle where
a group of N persons have to cross a bridge at night. It is dark and they can only cross the bridge if they carry a lamp. Only one lamp is available and at most two persons can cross at the same time. It is not possible to cross from a side if the lamp is not on that side. The time of crossing is the time of the slowest person crossing.

In this simple exercise, the bridge crossing problem is modelled as
undiscounted Dynamic Programming problem with termination state. I know very little about this problem, and I made this script just for fun I guess other approaches exist which are more computationally efficient than this.

Anyway, this one works and can it be used to solve problems up to 10~15 persons in reasonable time.

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
02 Nov 2008 Bart

Bart (view profile)

I did not check if the file produces the right results, I only looked at the code.

The code does contain sufficient help and even an example. However, it does not have an H1 line meaning that you cannot use 'lookfor' to find the file in the future when you have forgotten the exact filename

It also does not contain any code to check if the input and output arguments are valid.

Furthermore, some code can be improved. Look at the suggestions of the M-lint checker and see if you can change the code.

Contact us