Knuth's Algorithm X: Difference between revisions

Content deleted Content added
Example: Describe the last reduction of the matrix in analogy to the previous reductions.
Example: Fixed typo
Tags: Mobile edit Mobile web edit
 
(2 intermediate revisions by one other user not shown)
Line 7:
Algorithm X works as follows:
 
{{quote frame|quote=
# If the matrix ''A'' has no columns, the current partial solution is a valid solution; terminate successfully.
# Otherwise choose a column ''c'' ([[deterministic algorithm|deterministically]]).
Line 17 ⟶ 16:
#: delete column ''j'' from matrix ''A''.
# Repeat this algorithm recursively on the reduced matrix ''A''.
 
}}
 
The nondeterministic choice of ''r'' means that the algorithm recurses over independent subalgorithms; each subalgorithm inherits the current matrix ''A'', but reduces it with respect to a different row ''r''.
Line 306 ⟶ 305:
 
:::{| class="wikitable"
! !! <span style="color:red">52</span> !! 7
|-
! ''F''
Line 346 ⟶ 345:
::: Step 1—The matrix is empty, thus this branch of the algorithm terminates successfully.
 
::: As rows ''B'', ''D'', and ''F'' have been electedselected (step 4), the final solution in this branch is:
 
::::{| class="wikitable"