Skip to content

Use shuffle to reduce bias #1

@hillmark

Description

@hillmark

Hi,

Great solver!

Just wondering whether it's worth revising hasSolution, so instead of:

for tileNumber in range(len(tiles)): #Loop through all the tiles, which produces...

unshuffled

shuffle the list first to reduce overuse of tiles with lower index, for example:

tileList = list(range(len(tiles)))
random.shuffle(tileList)
for tileNumber in tileList: #Loop through all the tiles

which produces...

shuffled

Note: this is mostly apparent in situations where the number of available tiles for each type of tile is unconstrained.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions