Help:Algorithms

From WikiMSK

An algorithm is a schematic drawing that helps organizing step by step approaches in a visually simplified way. An algorithm is formed by a set of boxes and lines that join them.

Create an Algorithm

Introduction

  • To begin an algorithm, you should start with the following code {{family tree/start}} and end it with {{family tree/end}}.
  • You can name an algorithm by starting with following: {{family tree/summary= Name of the algorithm}}
  • The algorithm consists of boxes that occupy virtual rows:
 
 
 
Box 1 in Row 1
 
 
 
 
 
 
 
 
 
Box 2 in Row 2
 
 
 
Box 3 in Row 3
 
 
 
 
 
 
Box 4 in Row 3



  • Each row is represented by the following where each | | represents a space.:

{{Family tree | | | | | | | | | }}


  • Each box is represented by the content that fills the space in | |, for example | A01 | will give:
 
A01
  • In order to link the boxes you need to use symbols. The basic symbols that you will most commonly use are the following:
    • ! will link two boxes placed vertically on top of each other
    • - will link two boxes placed horizontally next to each other
    • ^ will link bifurcate a line arising from a box into two branches.

Algorithm Basics

Linking cells horizontally:
You type:
{{Family tree/start}}
{{Family tree | | | | A01 |-| A02 | |A01= Box 1 in Row 1| A02= Box in Row 1}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
Box in Row 1
 
 
You type:
{{Family tree/start}}
{{Family tree | | | | A01 |-|-|-| A02 | |A01= Box 1 in Row 1| A02= Box in Row 1}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
Box in Row 1
 
 
 
 
You type:
{{Family tree/start}}
{{Family tree | | | | A01 |~| A02 | |A01= Box 1 in Row 1| A02= Box in Row 1}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
Box in Row 1
 
 
You type:
{{Family tree/start}}
{{Family tree | | | | A01 |~|~|~| A02 | |A01= Box 1 in Row 1| A02= Box in Row 1}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
Box in Row 1
 
 
 
 
Linking cells vertically:
You type:
{{Family tree/start}}
{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Box 2 in Row 2
 
 
 
You type:
{{Family tree/start}}
{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Box 2 in Row 2
 
 
 
You type:
{{Family tree/start}}
{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}
{{Family tree | | | | |:| | | | | }}
{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Box 2 in Row 2
 
 
 
You type:
{{Family tree/start}}
{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}
{{Family tree | | | | |:| | | | | }}
{{Family tree | | | | |:| | | | | }}
{{Family tree | | | | |:| | | | | }}
{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Box 2 in Row 2
 
 
 
More
You type: You get:
You type: You get:
You type: You get:
Putting it together:
You type:
{{Family tree/start}}
{{Family tree | | | | A01 | | | |A01= Box 1 in Row 1}}
{{Family tree | | | | |!| | | | | }}
{{Family tree | | | | B01 | | | |B01= Box 2 in Row 2}}
{{Family tree | |,|-|-|^|-|-|.| | }}
{{Family tree | C01 | | | | C02 |C01= Box 3 in Row 3| C02= Box 4 in Row 4}}
{{Family tree/end}}
You get:
 
 
 
Box 1 in Row 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Box 2 in Row 2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Box 3 in Row 3
 
 
 
Box 4 in Row 4
 

Advanced Algorithms

Please find below an image that summarizes the symbols used in creating algorithms.

Algorithm code.png

Samples

Sample 1
You type:
{{family tree/start |summary=Sample 1}}
{{family tree | | | | | | | | A01 | | | | | | | |A01=A01}} 
{{family tree | | | | |,|-|-|-|^|-|-|-|-|.| | | }}
{{family tree | | | B01 | | | | | | | | B02 | | |B01=B01|B02=B02}}
{{family tree | | | |!| | | | | | | | | |!| }}
{{family tree | | | C01 | | | | | | | | |!| |C01=C01}}
{{family tree | |,|-|^|.| | | | | | | | |!| }}
{{family tree | D01 | | D02 | | | | | | D03 |D01=D01|D02=D02|D03=D03}}
{{family tree | |!| | | | | | | | | |,|-|^|.| }}
{{family tree | E01 | | | | | | | E02 | | | E03 |E01=E01|E02=E02|E03=E03}}
{{family tree | | | | | | | | | | |!| | | | |!| }}
{{family tree | | | | | | | | | | F01 | | | F02 |F01=F01|F02=F02}}
{{family tree/end}}
You get:
 
 
 
 
 
 
 
A01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
B01
 
 
 
 
 
 
 
B02
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
C01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
D01
 
D02
 
 
 
 
 
D03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
E01
 
 
 
 
 
 
E02
 
 
E03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
F01
 
 
F02
Sample 2
You type:
{{family tree/start}}<nowiki>{{family tree | | | | | | | | | A01 | | | | | |A01=A01}}
{{family tree | | | | | | | | | |!| | | | | | | | }}
{{family tree | | | | | | | | | B01 | | | | | |B01=B01}}
{{family tree | | |,|-|-|-|-|-|-|^|-|-|-|-|-|-|.| }}
{{family tree | | C01 | | | | | | | | | | | |C02|C01=C01|C02=C02}}
{{family tree | | |!| | | | | | | | | | | | | |!| }}
{{family tree | | D01 | | | | | | | | | | | |D02|D01=D01'<br>D01''|D02=D02'<br>D02''}}
{{family tree | | |!| | | | | | | | | |,|-|-|-|+|-|-|-|-|.|}}
{{family tree | | E01 | | | | | | | | E02 | | E03 | | | E04 |E01=E01|E02=E02|E03=E03|E04=E04}}
{{family tree | | | | | | | | | | | | |!| | | |!| | | | |!| | }}
{{family tree | | | | | | | | | | | | F01 | | F02 | | | F03 |F01=F01|F02=F02|F03=F03}}
{{family tree/end}}
You get:
 
 
 
 
 
 
 
 
A01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
B01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
C01
 
 
 
 
 
 
 
 
 
 
 
C02
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
D01'
D01
 
 
 
 
 
 
 
 
 
 
 
D02'
D02
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
E01
 
 
 
 
 
 
 
E02
 
E03
 
 
E04
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
F01
 
F02
 
 
F03


Sample 3
You type:
{{family tree/start}}
{{family tree | | | | | | | | | A01 | | | | | |A01=A01}}
{{family tree | | | | | | | | | |!| | | | | | | | }}
{{family tree | | | | | | | | | B01 | | | | | |B01=B01}}
{{family tree | | |,|-|-|-|-|-|-|+|-|-|-|-|-|-|.| }}
{{family tree | | C01 | | | | | C02 | | | | | C03 |C01=C01|C02=C02|C03=C03}}
{{family tree | | | | | | | | | |!| | | | | | | | }}
{{family tree | |,|-|-|-|v|-|-|-|+|-|-|-|v|-|-|-|.| | }}
{{family tree | |!| | | |!| | | |!| | | |!| | | |!| | | }}
{{family tree | D01 | | D02 | | D03 | | D04 | | D05 |D01=D01|D02=D02|D03=D03|D04=D04|D05=D05}}
{{family tree | |!| | | | | | | | | | | | | | | |!| }}
{{family tree | E01 | | | | | | | | | | | | | | E02 |E01=E01|E02=E02}}
{{family tree/end}}


You get:
 
 
 
 
 
 
 
 
A01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
B01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
C01
 
 
 
 
C02
 
 
 
 
C03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
D01
 
D02
 
D03
 
D04
 
D05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
E01
 
 
 
 
 
 
 
 
 
 
 
 
 
E02


Sample 4
You type:
{{family tree/start |summary=PE diagnosis Algorithm.}}
{{family tree | | | | | | | | | | A01 | | | | |A01=A01}}
{{family tree | | | | | | | | | | |!| | | | | | | }}
{{family tree | | | | | | | | | | A02 | | | | | |A02=A02}}
{{family tree | | | |,|-|-|-|-|-|-|^|-|-|-|-|-|-|-|.| | | | | | }}
{{family tree | | | B01 | | | | | | | | | | | | | B02 | | |B01=B01|B02=B02}}
{{family tree | | | |!| | | | | | | | | | | | | | |!| | | | }}
{{family tree | | | C01 | | | | | | | | | | | | | C02 | | |C01=C01|C02=C02}}
{{family tree | |,|-|^|-|.| | | | | | | | | | |,|-|^|-|.| | }}
{{family tree | D01 | | D02 | | | | | | | | | D03 | | D04 |D01=D01|D02=D02|D03=D03|D04=D04}}
{{family tree | |!| | | |!| | | | | | | | | | |!| | | |!| | }}
{{family tree | E01 | | E02 | | | | | | | | | E03 | | |!| |E01=E01|E02=E02|E03=E03}}
{{family tree | | | | | |!| | | | | | | | | | |!| | | |!| | | | }}
{{family tree | | | | | F01 | | | | | | | | | F02 | | |!| |F01=F01|F02=F02}}
{{family tree | | | |,|-|^|-|.| | | | | | |,|-|^|-|.| |!| | }}
{{family tree | | | G01 | | G02 | | | | | G03 | | G04 |!| | |G01=G01|G02=G02|G03=G03|G04=G04}}
{{family tree | | | |!| | | |!| | | | | | |!| | | |!| |!| | }}
{{family tree | | | H01 | | H02 | | | | | |!| | | H03 |'| | | |H01=H01|H02=H02|H03=H03}}
{{family tree | | | |!| | | | | | | | | | |!| | | |!| | | | | }}
{{family tree | | | I01 | | | | | | | | | |!| | | I02 | | | |I01=I01|I02=I02}}
{{family tree | |,|-|^|-|.| | | | | | | | |!| |,|-|^|-|.| | | |}}
{{family tree | J01 | | J02 | | | | | | | |!| J03 | | J04 | | | |J01=J01|J02=J02|J03=J03|J04=J04}}
{{family tree | |!| | | | | | | | | | | | |!| |!| | | |!| | |}}
{{family tree | K01 |-|-|-|-|-|-|-|-|-|-|-|'| |!| | | K02 | |K01=K01|K02=K02}}
{{family tree | |!| | | | | | | | | | | | | | |!| | | | | | |}}
{{family tree | |`|-|-|-|-|-|-|-|-|-|-|-|-|-|-|'| | | | | | |}}
{{family tree/end}}
You get:
 
 
 
 
 
 
 
 
 
A01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
K01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
K02
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Sample 5
You type:
{{family tree/start |summary=PE diagnosis Algorithm.}}
{{family tree | | | | | | | | | |,|-| A01 |-| A02 | | | |A01= |A02= }}
{{family tree | | | | | | | | | |!| | | | | | | | | | | | | | | | | | }}
{{family tree | | | | | | | | | |)|-| B01 |-| B02 | | | |B01= |B02= }}
{{family tree | | | | | | | | | |!| | | | | | | | | | | | | | | | | | }}
{{family tree | | | | | | C01 |-|+|-| C02 |-| C03 | | | |C01= |C02= |C03= }}
{{family tree | | | | | | | | | |!| | | | | | | | | | | | | | | | | | }}
{{family tree | | | | | | | | | |)|-| D01 |-| D02 | | | |D01= |D02= }}
{{family tree | | | | | | | | | |!| | | | | | | | | | | | | | | | | | }}
{{family tree | | | | | | | | | |`|-| E01 |-| E02 | | | |E01= |E02= }}

{{family tree/end}}
You get:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Sample 6: Alignment and Bulleting
You type:
{{family tree/start |summary=Sample 6}}
{{family tree | | | | | | | | A01 |A01=A01}}
{{family tree | | | | |,|-|-|-|^|-|-|-|-|.| | | }}
{{family tree | | | B01 | | | | | | | | B02 | | |B01=B01|B02=B02}}
{{family tree | | | |!| | | | | | | | | |!| }}
{{family tree | | | C01 | | | | | | | | |!| |C01=C01}}
{{family tree | |,|-|^|-|.| | | | | | | |!| }}
{{family tree |boxstyle=text-align: left; | D01 | | D02 | | | | | | D03 |D01=• A<br>• B<br>• C<br>• D|D02=• E<br>• F<br>• G<br>• H|D03=• I<br>• J<br>• K<br>• L}}
{{family tree | | | | | | | | | | | |!| | | |!| }}
{{family tree | E01 | | | | | | | | E02 | | E03 |E01=E01|E02=E02|E03=E03}}
{{family tree | | | | | | | | | | | |!| | | |!| }}
{{family tree | | | | | | | | | | | F01 | | F02 |F01=F01|F02=F02}}
{{family tree/end}}
You get:
 
 
 
 
 
 
 
A01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
B01
 
 
 
 
 
 
 
B02
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
C01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
• A
• B
• C
• D
 
• E
• F
• G
• H
 
 
 
 
 
• I
• J
• K
• L
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
E01
 
 
 
 
 
 
 
E02
 
E03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
F01
 
F02