add function "getBest..." and modify many codes

1. add three exception class
2. class strategy defaultly init grid item to CONN
3. ensure strategy.checkGrid can raise NotTerminating (instead of
ViolateM)
4. ladderGenerator now do not return the first and last node of the
ladder
5. ensure ladderGenerator will not malfunction when subladderLength == 0