﻿# cuGraph renumbering: internal vertex indices are not durable dataset identities

Preserve the external-to-internal vertex mapping in cuGraph preprocessing and convert results deliberately without relying on row order or cross-run index stability.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-cugraph-renumbering-external-vertex-lineage/
Language: en

## Identify the namespace of a vertex column

A graph-feature pipeline receives account identifiers from a dataset and later exports numerical graph scores. The [cuGraph construction reference](https://docs.nvidia.com/cugraph/latest/api_docs/api/cugraph/cugraph.Graph.from_cudf_edgelist/) describes default renumbering into an internal contiguous vertex range. That range serves the graph representation; it is not automatically the dataset's identity namespace. Label every intermediate identifier column by its role so a downstream join cannot silently treat an internal index as an original account identifier.

## Preserve the mapping for the graph instance

Build the external-to-internal mapping as part of the specific graph preparation contract. Do not assume internal indices remain stable after changing the vertex population, edge input or construction path. Even an unchanged numeric index must be interpreted through the mapping that produced it. If feature arrays are indexed by internal vertices, retain enough graph lineage to explain which external entity each position represents before those arrays are stored, joined or compared with a later graph revision.

## Convert inputs through the intended interface

The [NumberMap conversion reference](https://github.com/rapidsai/cugraph/blob/main/python/cugraph/cugraph/structure/number_map.py) maps external identifiers to internal identifiers and warns about order or partitioning guarantees. When converting a list of query vertices, preserve an explicit query identity alongside the values. A returned sequence should not be attached to source records by assumed enumeration order. This is especially important when the source is a composite identity and several external columns together identify the vertex.

## Convert result identities without double conversion

The [unrenumber reference](https://docs.nvidia.com/cugraph/26.10/api_docs/api/cugraph/cugraph.Graph.unrenumber/) describes conversion of a result column containing internal identifiers back to external ones. Establish whether the particular algorithm already returned external IDs before applying conversion again. Preserve a row identity when alignment matters and use the documented ordering controls or explicit reconciliation. The mapping operation restores an identifier namespace; it should not be mistaken for a guarantee that every unrelated result column remains aligned by its original positional order.

## Check semantic round trips on recognizable vertices

Use external identifiers distinguishable from compact internal indices and include a composite-key case where supported. Verify the intended external entity after input conversion, graph calculation and result export. The guides on [logical table schemas](/journal/data-guide-frictionless-table-schema/) and [dataset sample identities](/journal/data-guide-coco-instance-caption-identities/) provide related context. Correct graph scores attached to wrong entities are still incorrect dataset features. Retaining the mapping and namespace boundaries makes the result interpretable beyond the lifetime of the in-memory graph object.
