Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search for K-best solutions #2005

Merged
merged 20 commits into from
Jan 28, 2025
Merged

Search for K-best solutions #2005

merged 20 commits into from
Jan 28, 2025

Conversation

dellaert
Copy link
Member

A new class that uses branch-and-bound search to find the K-best solutions quickly. Should be much more efficient than forming the product and enumerating all assignments. Works for both DiscreteBayesNets and DiscreteBayesTrees.

Testing:

time gtsam/discrete/tests/testDiscreteSearch

Number of expansions: 35 << Asia Bayes net
Number of expansions: 33 << Asia Bayes tree
There were no test failures

real 0m0.027s
user 0m0.006s
sys 0m0.010s

@dellaert dellaert requested a review from varunagrawal January 27, 2025 04:41
@dellaert dellaert self-assigned this Jan 27, 2025
@dellaert
Copy link
Member Author

@varunagrawal review this version? Substantial refactor coming in next PR

Copy link
Collaborator

@varunagrawal varunagrawal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some docstring improvements to be had, but pretty straightforward.

}
};

// Define the Solutions class
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe more information on why and where this is used so one doesn't have to go hunting through the source code?

gtsam/discrete/DiscreteSearch.cpp Show resolved Hide resolved
gtsam/discrete/DiscreteSearch.cpp Show resolved Hide resolved
gtsam/discrete/DiscreteValues.cpp Show resolved Hide resolved
gtsam/discrete/tests/AsiaExample.h Show resolved Hide resolved
@dellaert
Copy link
Member Author

OK, I will address all these comments in #2006

@dellaert dellaert merged commit 3f6ae48 into develop Jan 28, 2025
35 checks passed
@dellaert dellaert deleted the feature/k-best branch January 28, 2025 19:09
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.

2 participants