# Magic graph

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Magic_graph
> Markdown URL: https://mediated.wiki/source/Magic_graph.md
> Source: https://en.wikipedia.org/wiki/Magic_graph
> Source revision: 1330717216
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. Please help improve this article by introducing more precise citations. (November 2024) (Learn how and when to remove this message)

A **magic graph** is a [graph](/source/Graph_(discrete_mathematics)) whose edges are labelled by the first *q* positive [integers](/source/Integer), where *q* is the number of edges, so that the sum over the edges incident with any vertex is the same, independent of the choice of vertex; or it is a graph that has such a labelling. The name "magic" sometimes means that the integers are any positive integers; then the graph and the labelling using the first *q* positive integers are called **supermagic**.

A graph is **vertex-magic** if its vertices can be labelled so that the sum on any edge is the same. It is **total magic** if its edges and vertices can be labelled so that the vertex label plus the sum of labels on edges incident with that vertex is a constant.

There are a great many variations on the concept of magic labelling of a graph. There is much variation in terminology as well. The definitions here are perhaps the most common.

Comprehensive references for magic labellings and magic graphs are Gallian (1998), Wallis (2001), and Marr and Wallis (2013).

## Magic squares

[Euler diagram](/source/Euler_diagram) of properties of some types of 4 × 4 magic squares. Cells of the same colour sum to the magic constant.
* In 4 × 4 [most-perfect magic squares](/source/Most-perfect_magic_square), any 2 cells that are 2 cells diagonally apart (including wraparound) sum to half the magic constant, hence any 2 such pairs also sum to the magic constant.

A **semimagic square** is an *n* × *n* square with the numbers 1 to *n*2 in its cells, in which the sum of each row and column is the same. A semimagic square is equivalent to a magic labelling of the [complete bipartite graph](/source/Complete_bipartite_graph) *K**n*,*n*. The two vertex sets of *K**n*,*n* correspond to the rows and the columns of the square, respectively, and the label on an edge *r**i**s**j* is the value in row *i*, column *j* of the semimagic square.

The definition of semimagic squares differs from the definition of [magic squares](/source/Magic_square) in the treatment of the diagonals of the square. Magic squares are required to have diagonals with the same sum as the row and column sums, but for semimagic squares this is not required. Thus, every magic square is semimagic, but not vice versa.

## References

- Nora Hartsfield and [Gerhard Ringel](/source/Gerhard_Ringel) (1994, 2003), *Pearls in Graph Theory*, revised edition. Dover Publications, Mineola, N.Y. Section 6.1.

- [W. D. Wallis](https://en.wikipedia.org/w/index.php?title=W._D._Wallis&action=edit&redlink=1) (2001), *Magic Graphs*. Birkhäuser Boston, Boston, Mass. [ISBN](/source/ISBN_(identifier)) [0-8176-4252-8](https://en.wikipedia.org/wiki/Special:BookSources/0-8176-4252-8)

- [Alison M. Marr](/source/Alison_Marr) and W. D. Wallis (2013), *Magic Graphs*. Second edition. Birkhäuser/Springer, New York. [ISBN](/source/ISBN_(identifier)) [978-0-8176-8390-0](https://en.wikipedia.org/wiki/Special:BookSources/978-0-8176-8390-0); 978-0-8176-8391-7

- Joseph A. Gallian (1998), [A dynamic survey of graph labeling.](https://www.combinatorics.org/ojs/index.php/eljc/article/view/DS6) *Electronic Journal of Combinatorics*, vol. 5, Dynamic Survey 6. Updated many times.

v t e Magic polygons Types Magic circle Magic hexagon Magic hexagram Magic square Magic star Magic triangle Related shapes Alphamagic square Antimagic square Geomagic square Heterosquare Pandiagonal magic square Prime reciprocal magic square Most-perfect magic square Higher dimensional shapes Magic cube classes Magic hypercube Magic hyperbeam Classification Associative magic square Pandiagonal magic square Multimagic square Related concepts Latin square Word square Number Scrabble Eight queens puzzle Magic constant Magic graph Magic series

This graph theory-related article is a stub. You can help Wikipedia by adding missing information.

- [v](https://en.wikipedia.org/wiki/Template:Graph-stub)
- [t](/source/Template_talk%3AGraph-stub)
- [e](https://en.wikipedia.org/wiki/Special:EditPage/Template:Graph-stub)

---
Adapted from the Wikipedia article [Magic graph](https://en.wikipedia.org/wiki/Magic_graph) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Magic_graph?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
