IndexGraph[g]
replaces the vertices of the graph g by its vertex indices.
IndexGraph[g,r]
replaces the vertices with integers r, r+1, ….
IndexGraph[{vw,…},…]
uses rules vw to specify the graph g.


IndexGraph
IndexGraph[g]
replaces the vertices of the graph g by its vertex indices.
IndexGraph[g,r]
replaces the vertices with integers r, r+1, ….
IndexGraph[{vw,…},…]
uses rules vw to specify the graph g.
Details and Options

- IndexGraph works with undirected graphs, directed graphs, multigraphs, and mixed graphs.

Examples
open all close allBasic Examples (2)
Scope (7)
IndexGraph works with undirected graphs:
Replace the vertices with negative indices:
Use rules to specify the graph:
IndexGraph works with large graphs:
Properties & Relations (5)
IndexGraph has the same number of vertices as the original graph:
IndexGraph has the same number of edges as the original graph:
IndexGraph is isomorphic to the original graph:
Use VertexReplace to replace the vertices of the graph:
IndexGraph has the same adjacency matrix as the original graph:
See Also
Related Guides
Text
Wolfram Research (2010), IndexGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/IndexGraph.html (updated 2015).
CMS
Wolfram Language. 2010. "IndexGraph." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/IndexGraph.html.
APA
Wolfram Language. (2010). IndexGraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IndexGraph.html
BibTeX
@misc{reference.wolfram_2025_indexgraph, author="Wolfram Research", title="{IndexGraph}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/IndexGraph.html}", note=[Accessed: 13-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_indexgraph, organization={Wolfram Research}, title={IndexGraph}, year={2015}, url={https://reference.wolfram.com/language/ref/IndexGraph.html}, note=[Accessed: 13-August-2025]}