Commit 0ad4c07
added Viterbi algorithm (aimacode#1099)
* changed queue to set in AC3
Changed queue to set in AC3 (as in the pseudocode of the original algorithm) to reduce the number of consistency-check due to the redundancy of the same arcs in queue. For example, on the harder1 configuration of the Sudoku CSP the number consistency-check has been reduced from 40464 to 12562!
* re-added test commented by mistake
* added the mentioned AC4 algorithm for constraint propagation
AC3 algorithm has non-optimal worst case time-complexity O(cd^3 ), while AC4 algorithm runs in O(cd^2) worst case time
* added doctest in Sudoku for AC4 and and the possibility of choosing the constant propagation algorithm in mac inference
* removed useless doctest for AC4 in Sudoku because AC4's tests are already present in test_csp.py
* added map coloring SAT problems
* fixed typo errors and removed unnecessary brackets
* reformulated the map coloring problem
* Revert "reformulated the map coloring problem"
This reverts commit 20ab0e5.
* Revert "fixed typo errors and removed unnecessary brackets"
This reverts commit f743146.
* Revert "added map coloring SAT problems"
This reverts commit 9e0fa55.
* Revert "removed useless doctest for AC4 in Sudoku because AC4's tests are already present in test_csp.py"
This reverts commit b3cd24c.
* Revert "added doctest in Sudoku for AC4 and and the possibility of choosing the constant propagation algorithm in mac inference"
This reverts commit 6986247.
* Revert "added the mentioned AC4 algorithm for constraint propagation"
This reverts commit 03551fb.
* added map coloring SAT problem
* fixed build error
* Revert "added map coloring SAT problem"
This reverts commit 93af259.
* Revert "fixed build error"
This reverts commit 6641c2c.
* added map coloring SAT problem
* removed redundant parentheses
* added Viterbi algorithm1 parent fd52c72 commit 0ad4c07
2 files changed
Lines changed: 139 additions & 77 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
132 | 136 | | |
133 | 137 | | |
134 | 138 | | |
| 139 | + | |
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
| |||
160 | 165 | | |
161 | 166 | | |
162 | 167 | | |
| 168 | + | |
163 | 169 | | |
164 | 170 | | |
165 | 171 | | |
| |||
378 | 384 | | |
379 | 385 | | |
380 | 386 | | |
| 387 | + | |
381 | 388 | | |
382 | 389 | | |
383 | 390 | | |
| |||
409 | 416 | | |
410 | 417 | | |
411 | 418 | | |
| 419 | + | |
412 | 420 | | |
413 | 421 | | |
414 | 422 | | |
| |||
498 | 506 | | |
499 | 507 | | |
500 | 508 | | |
| 509 | + | |
501 | 510 | | |
502 | 511 | | |
503 | 512 | | |
| |||
510 | 519 | | |
511 | 520 | | |
512 | 521 | | |
| 522 | + | |
513 | 523 | | |
514 | 524 | | |
515 | 525 | | |
| |||
521 | 531 | | |
522 | 532 | | |
523 | 533 | | |
| 534 | + | |
524 | 535 | | |
525 | 536 | | |
526 | 537 | | |
| |||
547 | 558 | | |
548 | 559 | | |
549 | 560 | | |
| 561 | + | |
550 | 562 | | |
551 | 563 | | |
552 | 564 | | |
| |||
579 | 591 | | |
580 | 592 | | |
581 | 593 | | |
| 594 | + | |
582 | 595 | | |
583 | 596 | | |
584 | 597 | | |
| |||
612 | 625 | | |
613 | 626 | | |
614 | 627 | | |
| 628 | + | |
615 | 629 | | |
616 | 630 | | |
617 | 631 | | |
| |||
655 | 669 | | |
656 | 670 | | |
657 | 671 | | |
658 | | - | |
| 672 | + | |
659 | 673 | | |
660 | 674 | | |
661 | 675 | | |
| |||
671 | 685 | | |
672 | 686 | | |
673 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
674 | 715 | | |
675 | 716 | | |
676 | 717 | | |
| |||
702 | 743 | | |
703 | 744 | | |
704 | 745 | | |
| 746 | + | |
705 | 747 | | |
706 | 748 | | |
707 | 749 | | |
| |||
742 | 784 | | |
743 | 785 | | |
744 | 786 | | |
| 787 | + | |
745 | 788 | | |
746 | | - | |
| 789 | + | |
747 | 790 | | |
748 | 791 | | |
749 | 792 | | |
750 | 793 | | |
751 | 794 | | |
| 795 | + | |
752 | 796 | | |
753 | 797 | | |
754 | 798 | | |
| |||
772 | 816 | | |
773 | 817 | | |
774 | 818 | | |
775 | | - | |
| 819 | + | |
776 | 820 | | |
777 | 821 | | |
778 | 822 | | |
| |||
790 | 834 | | |
791 | 835 | | |
792 | 836 | | |
793 | | - | |
794 | | - | |
795 | | - | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
796 | 840 | | |
797 | 841 | | |
798 | 842 | | |
| |||
0 commit comments