# Functions

`DynaWAVE.dynawave`

— Function.```
dynawave(G1::SparseMatrixCSC,G2::SparseMatrixCSC,
S::AbstractMatrix, [ beta=0.5,seeds=[] ]);
skipalign=false,details=false) -> f [, M]
```

Given two dynamic networks and node similarities between them, align the two networks by running the DynaWAVE algorithm.

**Arguments**

`G1`

,`G2`

: input networks in sparse matrix format`S`

: node similarities beween the two networks`beta`

: weight between edge and node conservation,`beta=1.0`

weighs edge conservation highly while`beta=0.0`

weighs node conservation highly`seeds`

: seed aligned node pairs. For example, if we know that the 3rd node in the first network is aligned to the 7th node in the second network, and the 5th node in the first network is aligned to the 9th node in the second network, then we will set`seeds = [(3,7), (5,9)]`

**Keyword arguments**

`skipalign`

: Don't align; just return the alignment details in`WaveModel`

.`details`

: Returns`M`

, the`WaveModel`

.

**Output**

`f`

: Alignment, i.e. node mapping from`G1`

to`G2`

.`f[i] describes node pair`

nodes1[i], nodes2[f[i]]`, where`

nodes1`and`

nodes2`are the vectors of node names corresponding to`

G1`and`

G2` respectively.

`DynaWAVE.wave`

— Function.```
wave(G1::SparseMatrixCSC,G2::SparseMatrixCSC,
S::AbstractMatrix, [ beta=0.5,seeds=[] ]);
skipalign=false,details=false) -> f [, M]
```

Given two static networks and node similarities between them, align the two networks by running the WAVE algorithm (Yihan Sun, Joseph Crawford, Jie Tang, and Tijana Milenkovic, Simultaneous Optimization of Both Node and Edge Conservation in Network Alignment via WAVE, in Proceedings of the Workshop on Algorithms in Bioinformatics (WABI), Atlanta, GA, USA, September 10-12, 2015, pages 16-39).

**Arguments**

`G1`

,`G2`

: Input networks in sparse matrix format.`S`

: Node similarities beween the two networks.`beta`

: Weighs between edge and node conservation,`beta=1.0`

weighs edge conservation highly while`beta=0.0`

weighs node conservation highly`seeds`

: Seed aligned node pairs. For example, if we know that the 3rd node in the first network is aligned to the 7th node in the second network, and the 5th node in the first network is aligned to the 9th node in the second network, then we will set`seeds = [(3,7), (5,9)]`

.

**Keyword arguments**

`skipalign`

: Don't align; just return the alignment details in`WaveModel`

.`details`

: Returns`M`

, the`WaveModel`

.

**Output**

`f`

: Alignment, i.e. node mapping from`G1`

to`G2`

.`f[i] describes node pair`

nodes1[i], nodes2[f[i]]`, where`

nodes1`and`

nodes2`are the vectors of node names corresponding to`

G1`and`

G2` respectively.

`DynaWAVE.shufflealign`

— Function.```
shufflealign(method, G1::SparseMatrixCSC,G2::SparseMatrixCSC,
S::AbstractMatrix, beta::Float64,
seeds=[], details=false) -> f [, M]
```

Given two networks and node similarities between them, before aligning using either `dynawave`

or `wave`

, this shuffles each input network independently before passing the networks to `dynawave`

or `wave`

. This is to remove node order biases when the two networks being aligned have similar node sets with similar node orderings. This is for use in evaluation, where biases like this tend to show much better results that is actually possible with a particular method. We obviously do not want biases like these during evaluation.

For example, when aligning a network to itself evaluate a network alignment method, the node order of the two networks will be the same and the node set will be the same. This results in the network alignment method "knowing" the true node mapping, and often producing alignments of much higher quality that is actually possible with the method were the true node mapping not known. This method randomizes (shuffles) the node order before handing it to `dynawave`

or `wave`

and then returns the deshuffled alignment.

**Arguments**

`method`

: If`method = dynawave`

, run the DynaWAVE algorithm after shuffling the networks. If`method = wave`

, run the WAVE algorithm after shuffling the networks.

**Output**

`f`

: The resulting alignment has the correct node order with respect to the input`G1`

and`G2`

networks; i.e., it is "deshuffled".