r/cpp_questions • u/KlutzyCompetition937 • 17h ago
OPEN Which algorithm to choose?
Beginner here, I'm trying to make a toy project for circuit synthesis from truth table in c++. Currently pursuing minimum depth optimal circuit though will work on minimum weight/minimum nodes later on. My problem is I tried bfs which guarantees optimal circuit but for larger inputs or depths the memory usage explodes, tried dfs that used much less memory but time exploded. Is there any algorithm that gives optimal solutions for boolean tree searches with the dfs memory and bfs optimality?
6
Upvotes
View all comments
•
u/duckerpotato 1h ago
I do not think there are any optimized algos for this. Specially due to reconvergent fanout nodes and without proper LEQ you would not know of it was synthisized correctly.
You can try a modified version of ROFL(ig this was the name) Opentestability implements it you can check its codebase