# Mixed graph

A mixed graph G = (V, E, A) is a mathematical object consisting of a set of vertices (or nodes) V, a set of (undirected) edges E, and a set of directed edges (or arcs) A.[1]

## Definitions and Notation

Further information: Graph (discrete mathematics)
Example of mixed graph

Consider adjacent vertices ${\displaystyle u,v\in V}$. A directed edge, called an arc, is an edge with an orientation and can be denoted as ${\displaystyle {\overrightarrow {uv}}}$ or ${\displaystyle (u,v)}$ (note that ${\displaystyle u}$ is the tail and ${\displaystyle v}$ is the head of the arc).[2] Also, an undirected edge, or edge, is an edge with no orientation and can be denoted as ${\displaystyle uv}$ or ${\displaystyle [u,v]}$.[2]

Further information: Multiple edges
Further information: Loop (graph theory)

For the purpose of our application example we will not be considering loops or multiple edges of mixed graphs.

A cycle of a mixed graph, or mixed cycle, is formed if the directed edges of the mixed graph form a cycle.[1] An orientation of a mixed graph is considered acyclic if cycles cannot be formed from the directed edges.[1] We call a mixed graph acyclic if all of its orientations are acyclic.[1]

## Coloring

Further information: Graph coloring
Example of mixed graph

Mixed graph coloring can be thought of as a labeling or an assignment of k different colors (where k is a positive integer) to the vertices of a mixed graph.[3] Different colors must be assigned to vertices that are connected by an edge. The colors may be represented by the numbers from 1 to k, and for a directed arc, the tail of the arc must be colored by a smaller number than the head of the arc.[3]

### Example

For example, consider the figure to the right. Our available k-colors to color our mixed graph are ${\displaystyle \{1,2,3\}}$. Since ${\displaystyle u}$ and ${\displaystyle v}$ are connected by an edge, they must receive different colors or labelings (${\displaystyle u}$ and ${\displaystyle v}$ are labelled 1 and 2, respectively). We also have an arc from ${\displaystyle v}$ to ${\displaystyle w}$. Since orientation assigns an ordering, we must label the tail (${\displaystyle v}$) with a smaller color (or integer from our set) than the head (${\displaystyle w}$) of our arc.

### Strong and weak coloring

A (strong) proper k-coloring of a mixed graph is a function

${\displaystyle c:V\rightarrow [k]}$ where ${\displaystyle [k]:={1,2,\dots ,k}}$ such that ${\displaystyle c(u)\neq c(v)}$ if ${\displaystyle uv\in E}$ and ${\displaystyle c(u) if ${\displaystyle {\overrightarrow {uv}}\in A}$.[1]

A weaker condition on our arcs can be applied and we can consider a weak proper k-coloring of a mixed graph to be a function

${\displaystyle c:V\rightarrow [k]}$ where ${\displaystyle [k]:={1,2,\dots ,k}}$ such that ${\displaystyle c(u)\neq c(v)}$ if ${\displaystyle uv\in E}$ and ${\displaystyle c(u)\leq c(v)}$ if ${\displaystyle {\overrightarrow {uv}}\in A}$.[1] Referring back to our example, this means that we can label both the head and tail of ${\displaystyle (v,w)}$ with the positive integer 2.

### Existence

A coloring may or may not exist for a mixed graph. In order for a mixed graph to have a k-coloring, the graph cannot contain any directed cycles.[2] If such a k-coloring exists, then we refer to the smallest k needed in order to properly color our graph as the chromatic number, denoted ${\displaystyle \chi (G)}$.[2] We can count the number of proper k-colorings as a polynomial function of k. This is called the chromatic polynomial of our graph G (by analogy with the chromatic polynomial of undirected graphs) and can be denoted as ${\displaystyle \chi _{G}(k)}$.[1]

### Computing weak chromatic polynomials

The deletion–contraction method can be used to compute weak chromatic polynomials of mixed graphs. This method involves deleting (or removing) an edge or arc and contracting (or joining) the remaining vertices incident to that edge (or arc) to form one vertex.[4] After deleting an edge, ${\displaystyle e}$, from a mixed graph ${\displaystyle G=(V,E,A)}$ we obtain the mixed graph ${\displaystyle (V,E-e,A)}$.[4] We can denote this deletion of the edge, ${\displaystyle e}$, as ${\displaystyle G-e}$. Similarly, by deleting an arc, ${\displaystyle a}$, from a mixed graph, we obtain ${\displaystyle (V,E,A-a)}$ where we can denote the deletion of ${\displaystyle a}$ as ${\displaystyle G-a}$.[4] Also, we can denote the contraction of ${\displaystyle e}$ and ${\displaystyle a}$ as ${\displaystyle G/e}$ and ${\displaystyle G/a}$, respectively.[4] From Propositions given in,[4] we obtain the following equations to compute the chromatic polynomial of a mixed graph:

1. ${\displaystyle \chi _{G}(k)=\chi _{G-e}(k)-\chi _{G/e}(k)}$,[5]
2. ${\displaystyle \chi _{G}(k)=\chi _{G-a}(k)+\chi _{G/a}(k)-\chi _{G_{a}}(k)}$.[5]

## Applications

### Scheduling problem

Main article: Disjunctive graph

Mixed graphs may be used to model job shop scheduling problems in which a collection of tasks is to be performed, subject to certain timing constraints. In this sort of problem, undirected edges may be used to model a constraint that two tasks are incompatible (they cannot be performed simultaneously). Directed edges may be used to model precedence constraints, in which one task must be performed before another. A graph defined in this way from a scheduling problem is called a disjunctive graph. The mixed graph coloring problem can be used to find a schedule of minimum length for performing all the tasks.[2]

### Bayesian inference

Mixed graphs are also used as graphical models for Bayesian inference. In this context, an acyclic chain graph (one with no cycles of directed edges) is also called a chain graph. The directed edges of these graphs are used to indicate a causal connection between two events, in which the outcome of the first event influences the probability of the second event. Undirected edges, instead, indicate a non-causal correlation between two events. A connected component of the undirected subgraph of a chain graph is called a chain. A chain graph may be transformed into an undirected graph by constructing its moral graph, an undirected graph formed from the chain graph by adding undirected edges between pairs of vertices that have outgoing edges to the same chain, and then forgetting the orientations of the directed edges.[6]

## Notes

1. Beck et al. (2013, p. 1)
2. Ries (2007, p. 1)
3. ^ a b
4. Beck et al. (2013, p. 4)
5. ^ a b Beck et al. (2013, p. 5)
6. ^