Esempio n. 1
0
  def testChooseColumn(self):
    matrix = SparseMatrix(rows1)
    dlx = DLX(matrix)
    coltable = matrix.column_table

    column = dlx.choose_column()

    assert coltable[0] == column

    matrix.cover(column) 

    # See Figure 3; column D now only has one node in it.
    after_cover = dlx.choose_column()
    assert coltable[3] == after_cover
Esempio n. 2
0
    def testChooseColumn(self):
        matrix = SparseMatrix(rows1)
        dlx = DLX(matrix)
        coltable = matrix.column_table

        column = dlx.choose_column()

        assert coltable[0] == column

        matrix.cover(column)

        # See Figure 3; column D now only has one node in it.
        after_cover = dlx.choose_column()
        assert coltable[3] == after_cover