py-aiger icon indicating copy to clipboard operation
py-aiger copied to clipboard

Speed up composition

Open mvcisback opened this issue 5 years ago • 0 comments

Currently, composition seems to scale super linearly in the size of the circuit. The appears to also hold true for all functions that rely on modify_leafs

https://github.com/mvcisback/py-aiger/blob/master/aiger/aig.py#L246

This function performs a recursive traversal of the DAG and modifies the leafs. However, currently this results in the entire DAG being rebuilt with each call of modify_leafs.

The proposal is to use a persistent datastructure that allows for targeted changes to the DAG.

Pyrsistent seems promising. Changing the NamedTuples with PRecords may do the trick.

mvcisback avatar Mar 29 '19 21:03 mvcisback