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 allclose all

Basic Examples  (2)

Replace the vertices of the graph with their vertex indices:

Replace the vertices with indices starting from 6:

Scope  (7)

IndexGraph works with undirected graphs:

Directed graphs:

Multigraphs:

Mixed 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:

Wolfram Research (2010), IndexGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/IndexGraph.html (updated 2015).

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_2024_indexgraph, author="Wolfram Research", title="{IndexGraph}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/IndexGraph.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_indexgraph, organization={Wolfram Research}, title={IndexGraph}, year={2015}, url={https://reference.wolfram.com/language/ref/IndexGraph.html}, note=[Accessed: 21-November-2024 ]}