Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Generate a round-robin tournament graph
ResourceFunction["TournamentGraph"][n] generates a balanced directed tournament on n vertices in which each vertex has nearly the same number of outgoing and incoming edges. | |
ResourceFunction["TournamentGraph"][n,"Cyclic"] generates a balanced directed tournament on n vertices in which each vertex has nearly the same number of outgoing and incoming edges. | |
ResourceFunction["TournamentGraph"][n,"Acyclic"] generates an acyclic directed tournament of n vertices by assigning a direction to each edge according to the vertex list order, so that the edge is directed as u→v if u precedes v in the vertex list, andv→u otherwise. | |
ResourceFunction["TournamentGraph"][n,"Random"] generates a random directed tournament of n vertices by assigning a random direction to each edge. |

Generate a tournament graph of 7 vertices. If no type is specified, it returns a cyclic graph:
| In[1]:= |
| Out[1]= | ![]() |
Generate a cyclic tournament graph of 7 vertices:
| In[2]:= |
| Out[2]= | ![]() |
Generate an acyclic tournament graph of 7 vertices:
| In[3]:= |
| Out[3]= | ![]() |
Generate a random tournament graph of 7 vertices:
| In[4]:= |
| Out[4]= | ![]() |
Generate the first "Cyclic" tournaments:
| In[5]:= | ![]() |
| Out[5]= | ![]() |
Generate the first "Acyclic" tournaments:
| In[6]:= | ![]() |
| Out[6]= | ![]() |
Generate "Random" tournaments:
| In[7]:= | ![]() |
| Out[7]= | ![]() |
Specify an annotation for vertices:
| In[8]:= |
| Out[8]= | ![]() |
Specify an annotation for edges:
| In[9]:= |
| Out[9]= | ![]() |
Highlight the vertex 1:
| In[10]:= |
| Out[10]= | ![]() |
Highlight the edge 23:
| In[11]:= |
| Out[11]= | ![]() |
Highlight both vertices and edges:
| In[12]:= |
| Out[12]= | ![]() |
Use a common base theme:
| In[13]:= |
| Out[13]= | ![]() |
Use a monochrome theme:
| In[14]:= |
| Out[14]= | ![]() |
By default, the size of vertices is computed automatically:
| In[15]:= |
| Out[15]= | ![]() |
Specify the size of all vertices using symbolic vertex size:
| In[16]:= |
| Out[16]= | ![]() |
Specify the size for individual vertices:
| In[17]:= |
| Out[17]= | ![]() |
Style all vertices:
| In[18]:= | ![]() |
| Out[18]= | ![]() |
Style individual vertices:
| In[19]:= |
| Out[19]= | ![]() |
The default GraphLayout is "CircularEmbedding":
| In[20]:= |
| Out[20]= | ![]() |
Specify any layout:
| In[21]:= |
| Out[21]= | ![]() |
The number of vertices of TournamentGraph [n] is n:
| In[22]:= | ![]() |
| Out[5]= |
Number of edges of TournamentGraph [n] is
:
| In[23]:= | ![]() |
| Out[5]= |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License