Solving Missionaries and Cannibals Problem with Simulink Design Verifier

Version (33.7 KB) by Mikhail
Missionaries and Cannibals Problem solved with Simulink Design Verifier (and simple visualization)


Updated 23 Jan 2017

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

The missionaries and cannibals problem is one of the classic river-crossing problems.
Three missionaries and three cannibals must cross a river using a boat which can carry at most two people, under the constraint that, for both banks, if there are missionaries present on the bank, they cannot be outnumbered by cannibals (if they were, the cannibals would eat the missionaries). The boat cannot cross the river by itself with no people on board.

You can use either property proving mode (to generate counter example) or test generation mode (to generate test case directly) of Simulink Design Verifier.

Also a simple script for visualization of results is provided. Cannibals are red squares, missionaries are green circles, the boat is a triangle.

Cite As

Mikhail (2023). Solving Missionaries and Cannibals Problem with Simulink Design Verifier (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Use one Scope block for better visualization
Slight update of description