Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ jobs:
command: |
. env/bin/activate
pip install .
[[ "$(pip show dwave-networkx 2>/dev/null | grep Version)" == "Version: $CIRCLE_TAG" ]]
[[ "$(pip show dwave-graphs 2>/dev/null | grep Version)" == "Version: $CIRCLE_TAG" ]]

- run:
name: Build sdist and bdist
Expand All @@ -219,17 +219,17 @@ workflows:
matrix:
parameters:
python-version: &python-versions ["3.10", "3.11", "3.12", "3.13", "3.14"]
dependency-versions: ["dimod==0.12.5 networkx==2.4 oldest-supported-numpy", # oldest supported
"dimod networkx numpy", # latest
dependency-versions: [&dependencies-oldest "dimod==0.12.5 networkx==2.4 oldest-supported-numpy",
&dependencies-latest "dimod networkx numpy",
]
exclude:
# dimod < 0.12.13 not supported on py312+
- python-version: "3.12"
dependency-versions: "dimod==0.12.5 networkx==2.4 oldest-supported-numpy"
dependency-versions: *dependencies-oldest
- python-version: "3.13"
dependency-versions: "dimod==0.12.5 networkx==2.4 oldest-supported-numpy"
dependency-versions: *dependencies-oldest
- python-version: "3.14"
dependency-versions: "dimod==0.12.5 networkx==2.4 oldest-supported-numpy"
dependency-versions: *dependencies-oldest
- test-osx:
matrix:
parameters:
Expand Down
9 changes: 5 additions & 4 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[run]
# omit virtualenv and test files
omit = venv/*, */tests/*
source=dwave_networkx
source = dwave.graphs
omit = env/*, venv/*, */tests/*

[report]
exclude_lines:
include_namespace_packages = True
exclude_lines =
pragma: no cover
raise NotImplementedError
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build
_build
dist
dwave_networkx.egg-info
*.egg-info/
*.pyc

venv/
Expand Down
30 changes: 14 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
.. image:: https://img.shields.io/pypi/v/dwave-networkx.svg
:target: https://pypi.org/project/dwave-networkx
.. image:: https://img.shields.io/pypi/v/dwave-graphs.svg
:target: https://pypi.org/project/dwave-graphs

.. image:: https://codecov.io/gh/dwavesystems/dwave-networkx/branch/main/graph/badge.svg
:target: https://codecov.io/gh/dwavesystems/dwave-networkx
.. image:: https://codecov.io/gh/dwavesystems/dwave-graphs/branch/main/graph/badge.svg
:target: https://codecov.io/gh/dwavesystems/dwave-graphs

.. image:: https://circleci.com/gh/dwavesystems/dwave-networkx.svg?style=svg
:target: https://circleci.com/gh/dwavesystems/dwave-networkx
:target: https://circleci.com/gh/dwavesystems/dwave-graphs

==============
dwave-networkx
==============
============
dwave-graphs
============

.. start_dnx_about
.. start_graphs_about

dwave-networkx is an extension of `NetworkX <https://networkx.org>`_\ ---a
Python language package for exploration and analysis of networks and network
algorithms---for users of D-Wave quantum computers. It provides tools for
dwave-graphs provides tools for
working with quantum processing unit (QPU) topology graphs, such as the Pegasus
used on the Advantage\ :sup:`TM` quantum computer, and implementations of
graph-theory algorithms on D-Wave quantum computers and other binary quadratic
model (BQM) samplers.

This example generates a Pegasus graph of the size used by Advantage QPUs.

>>> import dwave_networkx as dnx
>>> graph = dnx.pegasus_graph(16)
>>> import dwave.graphs
>>> graph = dwave.graphs.pegasus_graph(16)

.. end_dnx_about
.. end_graphs_about

Installation
============
Expand All @@ -35,7 +33,7 @@ Installation

.. code-block:: bash

pip install dwave_networkx
pip install dwave-graphs

**Installation from source:**

Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# You can set these variables from the command line.
SPHINXOPTS = -q
SPHINXBUILD = sphinx-build
SPHINXPROJ = DWaveNetworkx
SPHINXPROJ = dwave
SOURCEDIR = .
BUILDDIR = build

Expand Down
52 changes: 26 additions & 26 deletions docs/algorithms.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _dnx_algorithms:
.. _graphs_algorithms:

==========
Algorithms
Expand All @@ -7,21 +7,21 @@ Algorithms
Implementations of graph-theory algorithms on the D-Wave system and other
binary quadratic model samplers.

.. currentmodule:: dwave_networkx
.. currentmodule:: dwave.graphs

.. _dnx_canonicalization:
.. _graphs_canonicalization:

Canonicalization
================

.. automodule:: dwave_networkx.algorithms.canonicalization
.. automodule:: dwave.graphs.algorithms.canonicalization

.. autosummary::
:toctree: generated/

canonical_chimera_labeling

.. _dnx_clique:
.. _graphs_clique:

Clique
======
Expand All @@ -35,7 +35,7 @@ that for every two vertices in C there exists an edge connecting the two.
:align: center
:scale: 40 %

.. automodule:: dwave_networkx.algorithms.clique
.. automodule:: dwave.graphs.algorithms.clique

.. autosummary::
:toctree: generated/
Expand All @@ -44,7 +44,7 @@ that for every two vertices in C there exists an edge connecting the two.
clique_number
is_clique

.. _dnx_coloring:
.. _graphs_coloring:

Coloring
========
Expand All @@ -67,7 +67,7 @@ The map-coloring problem is to assign a color to each region of a map

Coloring a map of Canada with four colors.

.. automodule:: dwave_networkx.algorithms.coloring
.. automodule:: dwave.graphs.algorithms.coloring

.. autosummary::
:toctree: generated/
Expand All @@ -78,7 +78,7 @@ The map-coloring problem is to assign a color to each region of a map
vertex_color
vertex_color_qubo

.. _dnx_cover:
.. _graphs_cover:

Cover
=====
Expand All @@ -96,7 +96,7 @@ edges of the graph are incident to at least one of the vertices in the set.
(the horizontal tile of the Chimera unit cell) and the red set (vertical
tile) connect to all 16 edges of the graph.

.. automodule:: dwave_networkx.algorithms.cover
.. automodule:: dwave.graphs.algorithms.cover

.. autosummary::
:toctree: generated/
Expand All @@ -105,7 +105,7 @@ edges of the graph are incident to at least one of the vertices in the set.
min_weighted_vertex_cover
min_vertex_cover

.. _dnx_elimination_ordering:
.. _graphs_elimination_ordering:

Elimination Ordering
====================
Expand All @@ -122,7 +122,7 @@ whose neighborhood induces a clique. A perfect elimination ordering is an
ordering of vertices :math:`1..n` such that any vertex :math:`i` is simplicial
for the subset of vertices :math:`i..n`.

.. automodule:: dwave_networkx.algorithms.elimination_ordering
.. automodule:: dwave.graphs.algorithms.elimination_ordering

.. autosummary::
:toctree: generated/
Expand All @@ -138,20 +138,20 @@ for the subset of vertices :math:`i..n`.
pegasus_elimination_order
treewidth_branch_and_bound

.. _dnx_markov:
.. _graphs_markov:

Markov Networks
===============

.. automodule:: dwave_networkx.algorithms.markov
.. automodule:: dwave.graphs.algorithms.markov

.. autosummary::
:toctree: generated/

sample_markov_network
markov_network_bqm

.. _dnx_matching:
.. _graphs_matching:

Matching
========
Expand All @@ -167,7 +167,7 @@ A matching is a subset of graph edges in which no vertex occurs more than once.
A matching for a Chimera unit cell: no vertex is incident to more than one
edge in the set of blue edges

.. automodule:: dwave_networkx.algorithms.matching
.. automodule:: dwave.graphs.algorithms.matching

.. autosummary::
:toctree: generated/
Expand All @@ -177,7 +177,7 @@ A matching is a subset of graph edges in which no vertex occurs more than once.
min_maximal_matching_bqm
min_maximal_matching

.. _dnx_maximum_cut:
.. _graphs_maximum_cut:

Maximum Cut
===========
Expand All @@ -195,15 +195,15 @@ between this subset and the remaining vertices is as large as possible.
nodes {4, 5, 6, 7} cuts 16 edges; adding or removing a node decreases the
number of edges between the two complementary subsets of the graph.

.. automodule:: dwave_networkx.algorithms.max_cut
.. automodule:: dwave.graphs.algorithms.max_cut

.. autosummary::
:toctree: generated/

maximum_cut
weighted_maximum_cut

.. _dnx_independent_set:
.. _graphs_independent_set:

Independent Set
===============
Expand All @@ -222,7 +222,7 @@ its member pairs.
(vertical tile) are independent sets of the graph, with no blue node
adjacent to another blue node and likewise for red nodes.

.. automodule:: dwave_networkx.algorithms.independent_set
.. automodule:: dwave.graphs.algorithms.independent_set

.. autosummary::
:toctree: generated/
Expand All @@ -239,7 +239,7 @@ Helper Functions

maximum_weighted_independent_set_qubo

.. _dnx_partitioning:
.. _graphs_partitioning:

Partitioning
============
Expand All @@ -258,14 +258,14 @@ is as small as possible.
and the nodes in red are in the '1' subset. There are no other arrangements
with fewer edges between two equally sized subsets.

.. automodule:: dwave_networkx.algorithms.partition
.. automodule:: dwave.graphs.algorithms.partition

.. autosummary::
:toctree: generated/

partition

.. _dnx_social:
.. _graphs_social:

Social
======
Expand All @@ -284,15 +284,15 @@ friendly/hostile interactions between vertices.
cleanly divided into two subsets, {Bob, Eve} and {Alice}, with friendly
relations within each subset and only hostile relations between the subsets.

.. automodule:: dwave_networkx.algorithms.social
.. automodule:: dwave.graphs.algorithms.social

.. autosummary::
:toctree: generated/

structural_imbalance
structural_imbalance_ising

.. _dnx_traveling_salesperson:
.. _graphs_traveling_salesperson:

Traveling Salesperson
=====================
Expand All @@ -308,7 +308,7 @@ weighted graph.

A traveling salesperson route of [2, 1, 0, 3].

.. automodule:: dwave_networkx.algorithms.tsp
.. automodule:: dwave.graphs.algorithms.tsp

.. autosummary::
:toctree: generated/
Expand Down
2 changes: 1 addition & 1 deletion docs/api_ref.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _dnx_api_ref:
.. _graphs_api_ref:

=============
API Reference
Expand Down
23 changes: 8 additions & 15 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# DWaveNetworkX documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 26 10:55:26 2017.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import os
import sys
sys.path.insert(0, os.path.abspath('.'))
Expand Down Expand Up @@ -32,13 +25,13 @@
master_doc = 'index'

# General information about the project.
project = u'D-Wave NetworkX'
copyright = u'2017, D-Wave Systems Inc'
author = u'D-Wave Systems Inc'
project = u'D-Wave Graphs'
copyright = u'2025, D-Wave Inc'
author = u'D-Wave Inc'

import dwave_networkx
version = dwave_networkx.__version__
release = dwave_networkx.__version__
import dwave.graphs
version = dwave.graphs.__version__
release = dwave.graphs.__version__

language = 'en'

Expand All @@ -56,11 +49,11 @@

todo_include_todos = True

modindex_common_prefix = ['dwave_networkx.']
modindex_common_prefix = ['dwave.graphs.']

doctest_global_setup = \
"""
import dwave_networkx as dnx
import dwave.graphs
import networkx as nx
"""

Expand Down
Loading