---
title: NodeCandidate (latest version)
description: API reference for samplomatic.graph_utils.NodeCandidate in the latest version of samplomatic
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/samplomatic/auto/graph-utils-node-candidate
---

# NodeCandidate

*class* `samplomatic.graph_utils.NodeCandidate(graph: PyDiGraph[T, S], node: T)`

[GitHub](https://github.com/Qiskit/samplomatic/tree/main/samplomatic/graph_utils/node_candidate.py#L25-L50)

Bases: [`Generic`](https://docs.python.org/3/library/typing.html#typing.Generic)\[`T`, `S`]

A node that we want to add to the graph, but not yet.

The node is only added when we ask for its [`node_idx`](#samplomatic.graph_utils.NodeCandidate.node_idx "samplomatic.graph_utils.NodeCandidate.node_idx") in the graph.

**Parameters**

- **graph** – The graph to add the node to.
- **node** – The node data for the node to add.

**Attributes Summary**

|                                                                                                                |                                                   |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| [`is_added`](#samplomatic.graph_utils.NodeCandidate.is_added "samplomatic.graph_utils.NodeCandidate.is_added") | Whether the node has yet been added to the graph. |
| [`node_idx`](#samplomatic.graph_utils.NodeCandidate.node_idx "samplomatic.graph_utils.NodeCandidate.node_idx") | The node index in the graph.                      |

**Attributes Documentation**

### is\_added

Whether the node has yet been added to the graph.

### node\_idx

The node index in the graph.
