Skip to content

swap::regroup fails on complicated reorderings #12

@tangentstorm

Description

@tangentstorm

The plan_regroup function makes a plan for moving variables into place.

The "plan" is just a hashmap of variables that need to be moved, and the position into which they should go. Unfortunately, it is not a very good plan.

The problem is this algorithm was designed for the simple needs of the swap solver: moving a set of variables up to the top. But now that we have reorder_by_force, which can generate a completely new ordering, it's quite possible to request orderings that the current algorithm can't solve for.

Basically, this algorithm needs to be reworked. In the meantime, it's still possible to achieve any ordering you want, simply by iteratively bringing the variables you want to the top. Start by passing [{everything else},{z}] to reorder, then `[{everything else},{y},{z}], until you have all your variables in individual hash sets.

I hope to fix this soon. I'm mostly putting this here in case anyone runs into the problem before it's fixed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions