This section briefly introduces the theoretical background for combinatorial conformal module. We apply algebraic topology method to consider our matching problem. Algebraic topology focuses on studying topological problems by algebraic methods and uses simple linear algebraic methods to solve these problems. The detailed description of algebraic topology methodology can be seen in [12], where the authors consider these methods on surfaces with Riemann structure. In this paper, we apply algebraic topology method to the graph setting and consider combinatorial Hodge theory on graphs. Combinatorial Hodge theory can deduce a unique combinatorial conformal module for each graph, so it can be viewed as the fingerprint of a given graph.

We consider all objects on a three-connected planar graph *G* which is embedded on a topological surface *S*. A planar graph means that there are no edge crossings on *G* and different edges of the graph can only intersect at the endpoints. So each face of *G* can be viewed as a topological disk. We usually use a triple *G* = (*V*, *E*, *F*) to represent a graph, where *V* is the vertex set, *E* is the edge set and *F* is the face set. At the first step, we need to introduce some tools about computational topology. These similar concepts are defined on surfaces with Riemann structure in [12]. Here we use them on graphs.

The vertex set is denoted as

$$ V=\left\{{v}_1,{v}_2,\cdots, {v}_n\right\}. $$

(1)

Each oriented edge *e* is denoted as

$$ e=\left[{v}_i,{v}_j\right]\kern0.24em \mathrm{or}\kern0.24em e=-\left[{v}_j,{v}_i\right], $$

(2)

where *v*_{i}, *v*_{j} are its two endpoints.

A face *f* is represented as

$$ f=\left[{v}_{i_1},{v}_{i_2},\cdots, {v}_{i_k}\right], $$

(3)

where \( {v}_{i_k} \) is its vertex and (*i*_{1}, *i*_{2}, ⋯, *i*_{k}) is any cyclic permutation of (1, 2, ⋯, *k*).

We call the vertices of *G* as 0-dimensional cells, the oriented edges of *G* as 1-dimensional cells and the faces of *G* as 2-dimensional cells. Their linear combinations can form a linear chain space. We will give some definitions on the chain space of a graph.

The *k*-dimensional chain group of a graph *G* = (*V*, *E*, *F*) is given by

$$ {C}_k\left(G,\mathrm{\mathbb{Z}}\right)=\left\{\sum \limits_{i=1}^{n_k}{\xi}_i{\varepsilon}_k^i,{\xi}_i\in \mathrm{\mathbb{Z}}\right\}, $$

(4)

where \( {\varepsilon}_k^i \) denotes the *i*th *k*-dimensional cell of *G*_{.} We call each element of *C*_{k}(*G*, *Z*) as a *k*-chain of *G*.

**Definition 1**: The *k*-dimensional boundary operator *∂*_{k} : *C*_{k}(*G*, ℤ) → *C*_{k − 1}(*G*, ℤ) on graph *G* is defined as

$$ {\partial}_k\left(\sum \limits_{i=1}^{n_k}{\xi}_i{\varepsilon}_k^i\right):= \sum \limits_{i=1}^{n_k}{\xi}_i{\partial}_k\left({\varepsilon}_k^i\right). $$

(5)

The boundary operator has the linear property. In this paper, we only consider the low dimensional boundary operator, for instance,

$$ {\partial}_0{v}_i=0,{\partial}_1\left[{v}_i,{v}_j\right]={v}_j-{v}_i,{\partial}_2\left[{v}_i,{v}_j,{v}_k\right]=\left[{v}_i,{v}_j\right]+\left[{v}_j,{v}_k\right]+\left[{v}_k,{v}_j\right]. $$

(6)

The *k*-chain in the kernel of *∂*_{k} satisfies

$$ \mathit{\operatorname{Ker}}\ {\partial}_k=\left\{{\varepsilon}_k\in {C}_k\left(G,\mathrm{\mathbb{Z}}\right)|{\partial}_k{\varepsilon}_k=0\right\}. $$

(7)

We call each element in *Ker ∂*_{k} as a closed chain. The closed chains are closed loops and the boundaries of any 2-dimensional patches are called as boundary loops.

The *k*-chain in the image of *∂*_{k + 1} satisfies

$$ Img\ {\partial}_{k+1}=\left\{{\varepsilon}_k\in {C}_k\left(G,Z\right)|\exists {\varepsilon}_{k+1}\in {C}_{k+1}\left(G,Z\right),{\varepsilon}_k={\partial}_{k+1}{\varepsilon}_{k+1}\right\}. $$

(8)

Each element of *Img ∂*_{k + 1} is called as an exact chain.

**Property 1**: The boundary of a boundary is empty:

$$ {\partial}_k\circ {\partial}_{k+1}\equiv 0. $$

(9)

The proof can be seen in [12].

From the above property, we can easily obtain that *Img ∂*_{k + 1} is a sub-linear space of *Ker ∂*_{k}. The complementary space is called as the homology group of the graph.

**Definition 2**: Suppose *∂*_{k} : *C*_{k}(*G*, ℤ) → *C*_{k − 1}(*G*, ℤ) is the *k*-dimensional boundary operator on a graph *G*. *Ker ∂*_{k} = {*ε*_{k} ∈ *C*_{k}(*G*, ℤ)| *∂*_{k}*ε*_{k} = 0} is the kernel of *∂*_{k}. *Img ∂*_{k + 1} = {*ε*_{k} ∈ *C*_{k}| ∃*ε*_{k + 1} ∈ *C*_{k + 1}, *ε*_{k} = *∂*_{k + 1}*ε*_{k + 1}} is the image of *∂*_{k + 1}. The *k*-dimensional homology group of the graph *G* is defined as the quotient group, satisfying

$$ {H}_k\left(G,\mathrm{\mathbb{Z}}\right):= \frac{\mathit{\operatorname{Ker}}\ {\partial}_k}{Img\ {\partial}_{k+1}}. $$

(10)

Each element in *H*_{k}(*G*, *Z*) is called a *k*-dimensional homologous class. A closed *k*-chain *ε*_{k} ∈ *ker ∂*_{k} represents a homologous class, denoted as [*ε*_{k}] ∈ *H*_{k}(*G*, *Z*). Each element in the homologous class can form the basis of homology group. The similar algorithm in [12] is used to compute the homology basis of a discrete surface. Figures 1 and 2 show the homology basis of two graphs with different topology.

In order to do computation on graphs, we define the cohomology group which is the dual of the homology group. In fact, cohomology group is the space of linear functions defined on homology group. The following discussions are considered in parallel because all the objects are dual of the above counterparts such as co-chain and exterior differential operator.

The *k*-dimensional co-chain space of the graph *G* is a linear function defined on *k*-dimensional chain space and given by

$$ {C}^k\left(G,\mathrm{\mathbb{R}}\right)=\left\{{\omega}^k:{C}_k\left(G,Z\right)\to \mathrm{\mathbb{R}}\right\}. $$

(11)

We call each element in *C*^{k}(*G*, *R*) as a *k*-form.

The dual of the boundary operator *∂* is called as the exterior differential operator *d*.

**Definition 3**: The exterior differential operator *d*_{k} : *C*^{k}(*G*, ℝ) → *C*^{k + 1}(*G*, ℝ) is defined as follows:

$$ {d}_k{\omega}^k\left({\varepsilon}_{k+1}\right):= {\omega}^k\left({\partial}_{k+1}{\varepsilon}_{k+1}\right), $$

(12)

where *ω*^{k} ∈ *C*^{k}(*G*, *R*), *ε*_{k + 1} ∈ *C*_{k + 1}(*G*, *Z*).

Corresponding to closed chain, we have that any *k*-form in the kernel of *d*_{k} satisfies

$$ \mathit{\operatorname{Ker}}\ {d}_k=\left\{{\omega}^k\in {C}^k\left(G,\mathrm{\mathbb{R}}\right)|{d}_k{\omega}^k=0\right\}. $$

(13)

We call each element in *Ker d*_{k} as a closed *k*-form.

Similarly, any *k*-form in the image of *d*_{k} satisfies

$$ Img\ {d}_{k-1}=\left\{{\omega}^k\in {C}^k\left(G,R\right)|\exists {\omega}^{k-1}\in {C}^{k-1}\left(G,R\right),{\omega}^k={d}_{k-1}{\omega}^{k-1}\right\}. $$

(14)

We call each element in *Ker d*_{k} as an exact *k*-form.

From **Property 1**, we obviously obtain the following property.

**Property 2:** The exterior differential operator *d*_{k} : *C*^{k}(*G*, ℝ) → *C*^{k + 1}(*G*, ℝ) is a linear operator with the property

$$ {d}_k\circ {d}_{k-1}\equiv 0. $$

(15)

According to property 2, we have that exact forms are closed. Therefore, *Img d*_{k − 1} is a sub-linear space of *Ker d*_{k}. The complementary space is defined as the cohomology group of the graph.

**Definition 4**: Suppose the linear operator *d*_{k} : *C*^{k}(*G*, ℝ) → *C*^{k + 1}(*G*, ℝ) is the exterior differential operator on a graph *G*. *Ker d*_{k} = {*ω*^{k} ∈ *C*^{k}(*G*, ℝ)| *d*_{k}*ω*^{k} = 0} is the kernel of *d*_{k}. *Img d*_{k − 1} = {*ω*^{k} ∈ *C*^{k}(*G*, *R*)| ∃*ω*^{k − 1} ∈ *C*^{k − 1}(*G*, *R*), *ω*^{k} = *d*_{k − 1}*ω*^{k − 1}} is the image of *d*_{k − 1}. The *k*-dimensional cohomology group of the graph *G* is defined as the quotient group, satisfying

$$ {H}^k\left(G,R\right):= \frac{\mathit{\operatorname{Ker}}\ {d}_k}{Img\ {d}_{k-1}}. $$

(16)

A graph *G* embedded on a topological surface *S* can induce a CW-cell decomposition. The Poincare dual of *G* is denoted as \( \overline{G} \) which is also a graph embedded on *S* such that each vertex *v*_{i} of *G* corresponds to a face \( {\overline{v}}_i \) of \( \overline{G} \) and each face *f*_{j} of *G* corresponds to a vertex \( {\overline{f}}_j \) of \( \overline{G} \). Furthermore, each oriented edge *e* of *G* corresponds to an oriented edge \( \overline{e} \) on \( \overline{G} \) as follows: if *e* = [*v*_{i}, *v*_{j}], \( \overline{e}={\overline{v}}_i\cap {\overline{v}}_j \). Furthermore, if the left face of *e* is *f*_{l} and the right face of *e* is *f*_{r}, \( \overline{e}=\left[{\overline{f}}_r,{\overline{f}}_l\right] \).

**Definition 5**: Suppose a graph and its dual are denoted as *G* and \( \overline{G} \) respectively. The Hodge star operator \( {}^{\ast }:{C}^k\left(G,\mathrm{\mathbb{R}}\right)\to {C}^{2-k}\left(\overline{G},\mathrm{\mathbb{R}}\right) \) is a linear operator, satisfying

$$ {}^{\ast}\omega \left(\overline{\varepsilon}\right):= \omega \left(\varepsilon \right), $$

(17)

where *ω* ∈ *C*^{k}(*G*, *R*), *ε* ∈ *C*_{k}(*G*, *Z*), \( \overline{\varepsilon}\in {C}_{2-k}\left(\overline{G},Z\right) \), and \( {}^{\ast}\omega \in {C}^{2-k}\left(\overline{G},R\right) \).

Combining definition 3 and definition 5, we can obtain another linear operator *σ*_{k} : *C*^{k}(*G*, *R*) → *C*^{k − 1}(*G*, *R*), satisfying

$$ {\sigma}_k{=}^{\ast }{d_k}^{\ast }. $$

(18)

The operator *σ*_{k} can be viewed as the adjoint of the exterior differential operator, called as the co-differential operator. Combining operator *d*_{k} and *σ*_{k}, we can define the Laplace operator.

**Definition 6**: Suppose *d*_{k} : *C*^{k}(*G*, ℝ) → *C*^{k + 1}(*G*, ℝ) is the exterior differential operator on a graph \( G.{}^{\ast }:{C}^k\left(G,\mathrm{\mathbb{R}}\right)\to {C}^{2-k}\left(\overline{G},\mathrm{\mathbb{R}}\right) \) is the Hodge star operator on *G*. *σ*_{k} = ^{∗}*d*_{x}^{∗} : *C*^{k}(*G*, *R*) → *C*^{k − 1}(*G*, *R*) is the co-differential operator on *G*. The Laplace operator *Δ* : *C*^{k}(*G*, *R*) → *C*^{k}(*G*, *R*) is defined as

$$ \varDelta := {\sigma}_{k+1}{d}_k+{d}_{k-1}{\sigma}_k. $$

(19)

Obviously, the Laplace operator is symmetric, that is, for any *ξ*, *η* ∈ *C*^{k}(*G*, *R*),

$$ \left(\varDelta \zeta, \eta \right)=\left(\zeta, \varDelta \eta \right). $$

(20)

Furthermore,

$$ \left(\varDelta \zeta, \zeta \right)\ge 0. $$

(21)

We mainly consider functions whose values are equal to zero with the action of the Laplace operator. These functions have inspiring mathematical and physical properties. In this paper, we will compute these functions on the graph setting. Based on the combinatorial structure of a graph, the solution of harmonic functions is equivalent to solving combinatorial Laplace matrices on the graph. Finally, these combinatorial harmonic functions can give out the combinatorial conformal invariant of a given graph, called as conformal module, which can be used as the fingerprint of a given graph. So, the conformal module can be applied into matching applications on graphs.

**Definition 7**: Suppose *d*_{k} : *C*^{k}(*G*, ℝ) → *C*^{k + 1}(*G*, ℝ) is the exterior differential operator on a graph *G*. *σ*_{k} = ^{∗}*d*_{x}^{∗} : *C*^{k}(*G*, *R*) → *C*^{k − 1}(*G*, *R*) is the co-differential operator on *G*. *Δ* = *σ*_{k + 1}*d*_{k} + *d*_{k − 1}*σ*_{k} : *C*^{k}(*G*, *R*) → *C*^{k}(*G*, *R*) is the Laplace operator on *G*. A *k*-form *ω* ∈ *C*^{k}(*G*, ℝ) is called to be harmonic, if

$$ \varDelta \omega =0. $$

(22)

Since (*Δω*, *ω*) = |*d*_{k}*ω*|^{2} + |*σ*_{k}*ω*|^{2} = 0, we can easily have the following property.

**Property 3:** A harmonic *k*-form *ω* ∈ *C*^{k}(*G*, ℝ) satisfies

$$ \left\{\begin{array}{ccc}{d}_k\omega & =& 0\\ {}{\sigma}_k\omega & =& 0.\end{array}\right. $$

(23)

From the physical viewpoint, the exterior differential operator *d*_{k} is the curl operator and the co-differential operator *σ*_{k} is the divergence operator. So a harmonic *k*-form means that it is both curl-free and divergence-free.

The group of all the harmonic *k*-forms is denoted as \( {H}_{\Delta}^k\left(G,\mathrm{\mathbb{R}}\right) \), namely

$$ {H}_{\Delta}^k\left(G,\mathrm{\mathbb{R}}\right)=\mathit{\operatorname{Ker}}\ {d}_k\cap \mathit{\operatorname{Ker}}\ {\sigma}_k. $$

(24)

According to Hodge theory, any a *k*-form can be decomposed into an exact form, a co-exact form and a harmonic form.

**Theorem 1**: Suppose *ω* is a *k*-form. *d*_{k − 1} : *C*^{k − 1}(*G*, ℝ) → *C*^{k}(*G*, ℝ) is the exterior differential operator on a graph *G*. *σ*_{k} = ^{∗}*d*_{x}^{∗} : *C*^{k}(*G*, *R*) → *C*^{k − 1}(*G*, *R*) is the co-differential operator on *G*. Then there is a unique (*k* − 1)-form *α*, (*k* + 1)-form *β* and a harmonic *k*-form *γ*, such that

$$ \omega ={d}_{k-1}\alpha +{\sigma}_{k+1}\beta +\gamma; $$

(25)

moreover, such kind of decomposition is unique.

The detailed proof can be checked in [12].

For example *k* = 2, suppose *G* is embedded on a closed surface with genus *g*.{*γ*_{1}, *γ*_{2}, ⋯, *γ*_{2g}} is the generator of 1-dimensional homology group *H*_{1}(*G*, *Z*). Let *ω*_{1}, *ω*_{2} be two harmonic 1-forms with respect to the homology equivalence class, namely

$$ {\int}_{\gamma_k}{\omega}_1={\int}_{\gamma_k}{\omega}_2,k=1,2,\cdots, 2g. $$

(26)

Due to the linear property, we have

$$ {\displaystyle \begin{array}{ccccc}d\left({\omega}_1-{\omega}_2\right)& =& d{\omega}_1-d{\omega}_2& =& 0,\\ {}\sigma \left({\omega}_1-{\omega}_2\right)& =& {\sigma \omega}_1-{\sigma \omega}_2& =& 0.\end{array}} $$

(27)

So *ω*_{1} − *ω*_{2} is harmonic and \( {\int}_{\gamma_k}\left({\omega}_1-{\omega}_2\right)={\int}_{\gamma_k}{\omega}_1-{\int}_{\gamma_k}{\omega}_2=0.\left({\omega}_1-{\omega}_2\right) \) is exact. There is a function *f* : *G* → *R* such that *ω*_{1} − *ω*_{2} = *df*. According to the maximum principle and the empty boundary, *f* has no extremal value and is constant. That means the uniqueness holds: *ω*_{1} − *ω*_{2} = *df* = 0.

Suppose *ω* ∈ *H*^{1}(*G*, *R*) is closed and *f* : *G* → *R* is a smooth function. So *ω* + *df* and *ω* lie in the same cohomology class. The solution of *σ*(*ω* + *df*) = 0 is equivalent to the solution of Poisson equation:

$$ \varDelta f=-\sigma \omega . $$

(28)

In order to compute harmonic functions on a graph, we need define the combinatorial Laplace matrix.

**Definition 8**: Suppose *G* = {*v*_{1}, *v*_{2}, ⋯, *v*_{n}} is a planar graph. The combinatorial Laplace matrix Δ = (*δ*_{ij}) on *G* is defined as

where *v*_{i}~*v*_{j} means two vertices are adjacent and *d*(*v*_{i}) is the degree of *v*_{i} in the graph. According to theorem 1, the following Corollary is straightforward.

**Corollary:** The group of all harmonic *k*-forms on *G* is isomorphic to the *k*-dimensional cohomology group, that is

$$ {H}_{\Delta}^k\left(G,\mathrm{\mathbb{R}}\right)\cong {H}^k\left(G,\mathrm{\mathbb{R}}\right). $$

(30)

Suppose *ω*_{1} and *ω*_{2} are cohomological *k*-forms, then there is a (*k* − 1)-form *η*, such that *ω*_{1} = *ω*_{2} + *dη*. Assume the Hodge decomposition of *ω*_{1} is

$$ {\omega}_1=d{\alpha}_1+{\delta \beta}_1+{\gamma}_1=d{\alpha}_1+{\gamma}_1. $$

(31)

*dω*_{1} = 0, *dδβ*_{1} = 0, so *δβ*_{1} = 0. Directly, we get

$$ {\omega}_2=d\left({\alpha}_1-\eta \right)+{\gamma}_1. $$

(32)

That means two cohomological forms share the same harmonic form. Therefore, each cohomological class in *H*^{k}(*G*, *R*) corresponds to a unique harmonic form in \( {H}_{\Delta}^k\left(G,R\right) \), which establishes the isomorphism.

**Combinatorial Conformal Invariants:** Suppose a graph *G* is embedded on a genus *g* surface *S*. *ω* is a combinatorial harmonic 1-form on *G* and *γ* is a closed loop. We can choose a tubular neighborhood of *γ*,

$$ N\left(\gamma \right):= \left\{\alpha \in G|\alpha \cap \gamma \ne \varnothing \right\}. $$

(33)

We can periodically embed *N*(*γ*) to the plane. Each period is represented as a complex number, denoted as ∫_{γ}*ω*.

We can choose a canonical homology group basis in *H*_{1}(*G*, *Z*) as {*a*_{1}, *b*_{1}, *a*_{2}, *b*_{2}, ⋯, *a*_{g}, *b*_{g}}. Namely, they satisfy the following conditions

$$ {a}_i\cdot {b}_i=1,{a}_i\cdot {a}_j=0,{b}_i\cdot {b}_j=0, $$

(34)

where *a* ⋅ *b* represents the algebraic intersection number. Suppose a closed differential 1-form is *ω*. The integral of *ω* on *a*_{i}

$$ {\int}_{a_1}\omega, {\int}_{a_2}\omega, \cdots, {\int}_{a_g}\omega $$

(35)

is called as the *a*-period of *ω*. Similarly,

$$ {\int}_{b_1}\omega, {\int}_{b_2}\omega, \cdots, {\int}_{b_g}\omega $$

(36)

is called the *b*-period of *ω*.

For all *a*_{i}, slicing the surface *S* to get *S*_{i}, the boundary of *S*_{i} is \( \partial {S}_i={a}_i^{+}-{a}_i^{-} \). We construct a function *f*_{i} such that

$$ {f}_i\left({v}_k\right)=\left\{\begin{array}{c}1,{v}_k\in {a}_i^{+}\\ {}0,{v}_k\in {a}_i^{-}\\ {}\mathrm{random},\mathrm{otherwise}\end{array}\right., $$

(37)

and denote *α*_{i} = *df*_{i}.

For all *b*_{j}, slicing the surface *S* to get *S*_{j}, the boundary of *S*_{j} is \( \partial {S}_j={b}_j^{+}-{b}_j^{-} \). We construct a function *g*_{j} such that

$$ {g}_j\left({v}_k\right)=\left\{\begin{array}{c}1,{v}_k\in {b}_j^{+}\\ {}0,{v}_k\in {b}_j^{-}\\ {}\mathrm{random},\mathrm{otherwise}\end{array}\right., $$

(38)

and denote *β*_{j} = *dg*_{j}.

The combinatorial period matrix of *G* is as following:

$$ Mod(G)={\left(\underset{a_i}{\int }{\alpha}_j\right)}^{-1}\left(\underset{b_k}{\int }{\beta}_l\right). $$

(39)

For genus one case, the graph *G* can be embedded into the plane as a parallelogram. The combinatorial period matrix *Mod*(*G*) represents the shape of the parallelogram. For high genus graph *G*, the combinatorial period matrix is the generalization. The combinatorial period matrix can be used as the fingerprint of the embedded graph *G*.

One face *f*_{0} on the graph *G* is selected as the unique exterior face. Four vertices on the boundary of *f*_{0} are chosen, denoted as {*v*_{0}, *v*_{1}, *v*_{2}, *v*_{3}}, sorted counter clockwisely. The graph *G* with four corner vertices is called as a topological quadrilateral. The corner vertices divide the boundary of the exterior face into four segments, denoted as left, top, right, and bottom segments, such that *v*_{0} is the left lower corner. Then we can compute a harmonic function *u* : *G* → ℝ with Dirichlet boundary condition, namely

$$ \left\{\begin{array}{ccc}u\left({v}_i\right)& =& 1,{v}_i\in \mathrm{top},\\ {}u\left({v}_i\right)& =& 0,{v}_i\in \mathrm{bottom},\\ {}\Delta u\left({v}_i\right)& =& 0,\mathrm{otherwise}.\end{array}\right. $$

(40)

In fact, the harmonic 1-form *ω* is the exterior differential of *u*, *ω* = *du*.

**Theorem 2**: Suppose *G* is a topological quadrilateral which is a planar graph with an exterior face *f*_{0} and four corner vertices {*v*_{0}, *v*_{1}, *v*_{2}, *v*_{3}}. The harmonic 1-form maps the topological quadrilateral to a rectangle with width *w* and height *h*, then the conformal module of the topological quadrilateral is

$$ Mod\left(G,\left\{{v}_0,{v}_1,{v}_2,{v}_3\right\}\right):= \frac{h}{w}. $$

(41)

This theorem can be proven by an extremal length theory. More detailed proof is shown in [30].

So, there is a conformal mapping *ϕ* which maps a topological quadrilateral into a canonical rectangle and maps four vertices {*v*_{0}, *v*_{1}, *v*_{2}, *v*_{3}} into four corner vertices of the rectangle. The ratio of width and height is the conformal module. Four vertices {*v*_{0}, *v*_{1}, *v*_{2}, *v*_{3}} divide the boundary of the topological quadrilateral into four segments, denoted as Γ_{0}, Γ_{1}, Γ_{2}, Γ_{3} and *∂*Γ_{k} = *v*_{k + 1} − *v*_{k}. Solving two Dirichlet equations, there are two harmonic functions *f*_{1}, *f*_{2} : *G* → *R* which satisfy the Dirichlet boundary and the Neumann boundary:

$$ \left\{\begin{array}{ccc}\varDelta {f}_1& =& 0,\\ {}{\left.{f}_1\right|}_{\Gamma_0}& =& 0,\\ {}{\left.{f}_1\right|}_{\Gamma_2}& =& 1,\\ {}{\left.\frac{\partial {f}_1}{\partial n}\right|}_{\Gamma_1\cup {\Gamma}_3}& =& 0;\end{array}\right. $$

(42)

$$ \left\{\begin{array}{ccc}\varDelta {f}_2& =& 0,\\ {}{\left.{f}_2\right|}_{\Gamma_3}& =& 0,\\ {}{\left.{f}_2\right|}_{\Gamma_1}& =& 1,\\ {}{\left.\frac{\partial {f}_2}{\partial n}\right|}_{\Gamma_0\cup {\Gamma}_2}& =& 0.\end{array}\right. $$

(43)

where *n* is the normal vector. The gradient fields ∇*f*_{1} and ∇*f*_{2} are mutually vertical lines but are not conjugate to each other. A constant *λ* is necessary for the conformal mapping *ϕ* with \( \phi =\lambda {f}_2+\sqrt{-1}{f}_1 \). So *λ* is the width of the canonical rectangle. Due to the harmonic function with conformal invariant property, there is a mapping energy

$$ E\left({f}_1\right)={\int}_G{\left|\nabla {f}_1\right|}^2 dA=\lambda, $$

(44)

and

$$ \phi =E\left({f}_1\right){f}_2+\sqrt{-1}{f}_1. $$

(45)