Magic graph

A magic graph is a graph whose edges are labelled by the first q positive integers, 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.

A graph is vertex-magic if its vertices can be labelled so that the sum on any edge is the same.

There are a great many variations on the concept of magic labelling of a graph.

A semimagic square is equivalent to a magic labelling of the complete bipartite graph Kn,n.

The two vertex sets of Kn,n correspond to the rows and the columns of the square, respectively, and the label on an edge ri sj is the value in row i, column j of the semimagic square.

Euler diagram of requirements 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 , 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.