NAME
Graph::Maker::BestOf - create BestOf contest graph
SYNOPSIS
use Graph::Maker::BestOf;
$graph = Graph::Maker->new ('best_of', N => 7);
DESCRIPTION
Graph::Maker::BestOf creates Graph.pm graphs of best-of contests.
Two players play best-of N games. Each vertex represents a score A-B of how many games won by each. An edge goes from an A-B to (A+1)-B and A-(B+1) representing player A or B winning another game. The contest stops at N games or when one player has an insurmountable lead.
For example best-of 3,
1 N => 3
/ \
2 3
/ \ / \
4 5 6
/ \
7 8
Vertices 4 and 6 are scores 2-0 and 0-2 where the contest has been decided and there is no need for a 3rd game. Vertices 7 and 8 and 2-1 or 1-2 results, having played all 3 games.
If N is even the contest can end in a draw. For example best-of 4
1 N => 4
/ \
2 3
/ \ / \
4 5 6
/ \ / \ / \
7 8 9 10
/ \ / \
11 12 13
Vertices 7 and 10 are 3-0 and 0-3 with no need for a 4th game. Vertices 11 and 13 are 3-1 and 1-3 results or vertex 12 is a 2-2 draw.
FUNCTIONS
$graph = Graph::Maker->new('best_of', key => value, ...)-
The key/value parameters are
N => integer, number of games graph_maker => subr(key=>value) constructor, default Graph->newOther parameters are passed to the constructor, either
graph_makerorGraph->new().If the graph is directed (the default) then edges are added both up and down between each parent and child. Option
undirected => 1creates an undirected graph and for it there is a single edge from parent to child.
SEE ALSO
Graph::Maker, Graph::Maker::BalancedTree
HOME PAGE
http://user42.tuxfamily.org/graph-maker-other/index.html
LICENSE
Copyright 2015, 2016, 2017, 2018, 2019, 2020, 2021 Kevin Ryde
This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with This file. If not, see http://www.gnu.org/licenses/.