WOLFRAM

Copy to clipboard.
GraphSum[g1,g2]

gives the graph sum of the graphs g1 and g2.

Details and Options

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Sum of two graphs:

Out[1]=1

Generate complete graphs:

Out[1]=1

Graphs with parallel edges:

Out[2]=2

Scope  (29)Survey of the scope of standard use cases

Directed Graphs  (5)

GraphSum works with directed graphs:

Out[1]=1

Simple directed graphs:

Out[1]=1

Directed multigraphs:

Out[1]=1

Directed weighted graphs:

Out[1]=1

Directed annotated graphs:

Out[1]=1

Undirected Graphs  (5)

GraphSum works with undirected graphs:

Out[1]=1

Simple undirected graphs:

Out[1]=1

Undirected multigraphs:

Out[1]=1

Undirected weighted graphs:

Out[1]=1

Undirected annotated graphs:

Out[1]=1

Mixed Graphs  (5)

GraphSum works with mixed graphs:

Out[3]=3

Simple mixed graphs:

Out[1]=1

Mixed multigraphs:

Out[1]=1

Mixed weighted graphs:

Out[1]=1

Mixed annotated graphs:

Out[1]=1

Multigraphs  (5)

GraphSum works with multigraphs:

Out[1]=1

Directed multigraphs:

Out[1]=1

Mixed multigraphs:

Out[1]=1

Weighted multigraphs:

Out[1]=1

Annotated multigraphs:

Out[1]=1

Weighted Graphs  (5)

GraphSum works with weighted graphs:

Out[3]=3

Directed weighted graphs:

Out[1]=1

Undirected weighted graphs:

Out[1]=1

Mixed weighted graphs:

Out[1]=1

Annotated weighted graphs:

Out[1]=1

Special Graphs  (4)

GraphSum works on entity graphs:

Out[1]=1

GraphSum works on trees:

Out[1]=1

Use rules to specify the graph:

Out[1]=1

GraphSum works with more than two graphs:

Out[1]=1

Properties & Relations  (5)Properties of the function, and connections to other functions

The sum of any graph and its complement is a CompleteGraph:

Out[1]=1
Out[2]=2

The sum of any graph and itself is a multigraph:

Out[1]=1

The sum of graphs can be obtained by joining the edges of the graphs:

Out[1]=1

The sum of graphs can be obtained by adding their adjacency matrices together:

Out[1]=1
Out[2]=2

GraphSum gives the same result as GraphUnion if graphs have different vertex names:

Out[1]=1
Out[2]=2

Neat Examples  (1)Surprising or curious use cases

Out[1]=1
Wolfram Research (2022), GraphSum, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphSum.html.
Copy to clipboard.
Wolfram Research (2022), GraphSum, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphSum.html.

Text

Wolfram Research (2022), GraphSum, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphSum.html.

Copy to clipboard.
Wolfram Research (2022), GraphSum, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphSum.html.

CMS

Wolfram Language. 2022. "GraphSum." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GraphSum.html.

Copy to clipboard.
Wolfram Language. 2022. "GraphSum." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/GraphSum.html.

APA

Wolfram Language. (2022). GraphSum. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphSum.html

Copy to clipboard.
Wolfram Language. (2022). GraphSum. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphSum.html

BibTeX

@misc{reference.wolfram_2025_graphsum, author="Wolfram Research", title="{GraphSum}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/GraphSum.html}", note=[Accessed: 06-April-2025 ]}

Copy to clipboard.
@misc{reference.wolfram_2025_graphsum, author="Wolfram Research", title="{GraphSum}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/GraphSum.html}", note=[Accessed: 06-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_graphsum, organization={Wolfram Research}, title={GraphSum}, year={2022}, url={https://reference.wolfram.com/language/ref/GraphSum.html}, note=[Accessed: 06-April-2025 ]}

Copy to clipboard.
@online{reference.wolfram_2025_graphsum, organization={Wolfram Research}, title={GraphSum}, year={2022}, url={https://reference.wolfram.com/language/ref/GraphSum.html}, note=[Accessed: 06-April-2025 ]}