Back to Networkx

Graph---Undirected graphs with self loops

doc/reference/classes/graph.rst

latest1.4 KB
Original Source

.. _graph:

========================================= Graph---Undirected graphs with self loops

Overview

.. currentmodule:: networkx .. autoclass:: Graph

Methods

Adding and removing nodes and edges

.. autosummary:: :toctree: generated/

Graph.init Graph.add_node Graph.add_nodes_from Graph.remove_node Graph.remove_nodes_from Graph.add_edge Graph.add_edges_from Graph.add_weighted_edges_from Graph.remove_edge Graph.remove_edges_from Graph.update Graph.clear Graph.clear_edges

Reporting nodes edges and neighbors

.. autosummary:: :toctree: generated/

Graph.nodes Graph.iter Graph.has_node Graph.contains Graph.edges Graph.has_edge Graph.get_edge_data Graph.neighbors Graph.adj Graph.getitem Graph.adjacency Graph.nbunch_iter

Counting nodes edges and neighbors

.. autosummary:: :toctree: generated/

Graph.order Graph.number_of_nodes Graph.len Graph.degree Graph.size Graph.number_of_edges

Making copies and subgraphs

.. autosummary:: :toctree: generated/

Graph.copy Graph.to_undirected Graph.to_directed Graph.subgraph Graph.edge_subgraph