[lib] remove dependencies to networkx and matplotlib