Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
oorrja
GitHub Repository: oorrja/learntosolveit
Path: blob/master/source/python/algorithm_graph.rst
1241 views
====================
Representing a Graph
====================

Question
--------

Represent a Graph of V nodes and E edges in Python.
 
Solution
--------

.. literalinclude:: ../../languages/python/algorithm_graph.py
   :language: python
   :tab-width: 4

.. runcode:: ../../languages/python/algorithm_graph.py
   :language: python
   :codesite: ideone

Explanation
===========





.. seealso::

   * :python-suggest-improve:`algorithm_graph.py`
   * :python-better-explain:`algorithm_graph.rst`