Due: Friday March 12 at midnight
This project is related to the problem of recognizing objects in images. Given a known object and a new image, we want to determine whether or not that object is present in the image. Both the image and the object are represented as graphs, where a node corresponds to a region of pixels and the edges correspond to adjacencies between regions.
Suppose we have a model graph GM (the object) and an image graph GD (the image). With this representation, the problem reduces to: determining if there is a subgraph of GD isomorphic to GM (for perfect matches).
Suppose GM has vertices
|
||
or |
||
|
Suppose the above two graphs are stored in files triangle.graph and kite.graph. Then, the command
Match triangle.graph kite.graph
should output
ISOMORPHISM: (1,2),(2,3),(3,4) ISOMORPHISM: (1,2),(2,4),(3,3) ISOMORPHISM: (1,3),(2,2),(3,4) ISOMORPHISM: (1,3),(2,4),(3,2) ISOMORPHISM: (1,4),(2,2),(3,3) ISOMORPHISM: (1,4),(2,3),(3,2)
If there are no isomorphisms, output NO ISOMORPHISMS on a separate line with no punctuation.
You should turn in the following:
For your own amusement, you can try
All of the above files are included in the graphs.zip archive. You can use the triangle and kite graphs to help debug your program.