Algorithm::CP::IZ::FindFreeVar - FindFreeVar functions
use Algorithm::CP::IZ; my $iz = Algorithm::CP::IZ->new(); # create instances of Algorithm::CP::IZ::Int # contains domain {0..9} my $v1 = $iz->create_int(1, 9); my $v2 = $iz->create_int(1, 9); # add constraint $iz->Add($v1, $v2)->Eq(12); # specify FindFreeVar option value my $rc = $iz->search([$v1, $v2], { FindFreeVar => Algorithm::CP::IZ::FindFreeVar::Default } ); if ($rc) { print "ok\n"; } else { print "ng\n"; }
Algorithm::CP::IZ::FindFreeVar provides constants to sepcify search strategy.
Find first (in order of array) free variable.
Find free variable having minimum domain size. If variable having same size domain is found, first (in order of array) one is used.
Algorithm::CP::IZ Algorithm::CP::IZ::Int
Toshimitsu FUJIWARA, <tttfjw at gmail.com>
Copyright (C) 2015 by Toshimitsu FUJIWARA
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
http://www.perlfoundation.org/artistic_license_2_0
To install Algorithm::CP::IZ, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm::CP::IZ
CPAN shell
perl -MCPAN -e shell install Algorithm::CP::IZ
For more information on module installation, please visit the detailed CPAN module installation guide.