Skip to content

Choose better data structures for cost information during refinement process#95

Merged
francosansone merged 1 commit intosb-graph-devfrom
iss-94-choose-better-data-structures-for-cost-information-during-refinement-process
Aug 13, 2025
Merged

Choose better data structures for cost information during refinement process#95
francosansone merged 1 commit intosb-graph-devfrom
iss-94-choose-better-data-structures-for-cost-information-during-refinement-process

Conversation

@francosansone
Copy link
Copy Markdown
Collaborator

Very little and local change. Change CostMatrixImbalance from std::set to std::list. The insertion cost for std::set is O(log(n)) being n the size of the set. We don't need all the elements sorted, we only need to know which one is the one with greatest gain.

This PR changes CostMatrixImbalance to std::list to make the insertion cost O(1), comparing the new element with the one with better gain.

After a quick look, the partitioning time for the air conditioner with with a centralized controller goes from ~160ms to ~140ms.

@francosansone francosansone merged commit ee6f943 into sb-graph-dev Aug 13, 2025
2 checks passed
@francosansone francosansone deleted the iss-94-choose-better-data-structures-for-cost-information-during-refinement-process branch August 13, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Choose better data structures for cost information during refinement process

2 participants