Skip to content

Random Boolean matrices have non-zero False elements #8

@szarnyasg

Description

@szarnyasg

I noticed that in the Triangle-Counting notebook, Cohen's algorithm returns 1929 while the Sandia variants return 1919. This is clearly a bug but the problem is not in the algorithms but in the data: the Matrix.from_random() method produces non-zero elements with False values. This can be demonstrated as follows:

M = Matrix.from_random(BOOL, 10, 10, 4, no_diagonal=True, make_symmetric=True, seed=42)
M.to_lists()
[[0, 1, 2, 3, 4, 4, 6, 9],
 [9, 4, 6, 4, 1, 3, 2, 0],
 [True, True, True, False, True, False, True, True]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions