Sorting algorithms



Sorting items

Where to use them

A sorting algorithm is determining how teams in a standings table are ranked. There are many different ways to rank teams within a table. A table may be sorted by using just one sorting term like ratio between won matches against total played matches. In normal cases a table is sorted by using a combination of sorting terms like teams with higher number of won points rank higher, if two or more teams have the same amount of points, teams with the higher difference between goals won and goals lost  will rank higher and so on. To meet such different needs in VSporten supports customized sorting algorithms. Such an algorithm is build up by using a number of predefined bricks - so called sorting items. The list of the sorting items can be found below.


To establish a new sorting algorithm a user has to use the menu Administration->Sorting Algorithms.

The process of defining an algorithm is completed in two steps.

The first step is to register the name of the new algorithm. This is done by using the menu Administration->Sorting Algorithms-> Names.



The next step is to register the algorithm's sorting items and their order. This is completed by using the menu Administration->Sorting algorithms->Definitions

To define the entire sorting algorithm, the user has to add to the sorting algorithm all needed sorting items, one by one.

The first column contains the name of the sorting algorithm (Name). This name must be specified on each row belonging to the sorting algorithm. The second column (Term) contains the name of the sorting item. The last column (Sorting Order) should contain a number defining the order of the current sorting item.

In the figure above the standard sorting algorithm is ranking highest teams having higher amount of points, then goal difference, then number of scored goals etc.



The currently supported sorting items can be listed by using the menu Administration->Sorting Algorithms->Sorting Items


Where to use them

A sorting algorithm can be specified as a default sorting algorithm for the entire sport type.


The sport types' sorting algorithm is heritated by the definition of a new league (division). However within the division properties menu the user can assign another sorting algorithm.


Finally, a user can on-fly select a different sorting algorithm than the one assign to the current division. In particular the Fixed Rank algorithm can be chosen to force a ranking which not can be provided by any of the existing sorting algorithms.