NetworkX-style API