Queens · Traveling Sales Person
N-Queens solver applet: It solves in real-time the problem of how N queens can be positioned on a checkerboard in such a way that they do not threaten each other. It is a computationally expensive problem (NP-complete), and by having it solved in Java running on JCOP, we destroy the myth that a JavaCard(tm) implementation has to be slow.
Traveling Salesperson applet: You can enter up to 20 cities to be visited by a traveling salesperson in a GUI, and have JCOP compute the shortest path between the cities. This applet again shows the performance of JCOP even on NP- complete problems. The algorithm used is a heuristic one based on the simulated annealing algorithm (IBM patent). It shows both speed of JCOP as well as the quality of the random number generator.
You have to be aware that the applet runs a heuristic algorithm (hence its speed) and therefore does not always deliver the best solution (crossings in the path are proven to belong to imperfect solutions).
When giving the demo remember to enter the cities arbitrarily on the screen, as the first solution output by the card follows the order in which the points have been entered.
Questions, bug reports, and suggestions should be directed to javacard@zurich.ibm.com. Also visit our Website http://www.zurich.ibm.com/JavaCard for up-to-date information.