add comp support.
runnable version but mirror bug introduced by NetworkX.