Skip to content

Project for Introductory Programming (imperative approach) course

License

Notifications You must be signed in to change notification settings

magda-aug/Algorithm-X

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Algorithm X

Algorithm X solves exact cover problem with trial and error method.

Program reads sequence of rows F, W1,..., Wn, where F is filter and W1,..., Wn is an instance of exact cover problem.
All rows have the same length d. Row F contains "-" and "+" signs.
Every row W1,..., Wn contains at least one row other than "_".

Program returns sequence of rows representing solutions of instance W1,..., Wn transformed by filter F by removing positions which have "_" in filter F.

Solution of instance W1,..., Wn is set Q ⊆ {1,..., n} represented by text R of length d. This text does not contain "_" sign and satisifies condition

∀ 1 ≤ i ≤ d ∃ j ∈ Q ((Wj)i = Ri ∧ ∀k ∈ Q∖{j} (Wk)i = _ )

Solutions are built out of rows W1,..., Wn according to their ordering. Given one solution, by trial and error we choose signs not colliding with previous choices.

About

Project for Introductory Programming (imperative approach) course

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages