TreeGamePlot
TreeGamePlot[tgame]
generates a plot of the TreeGame tgame.
TreeGamePlot[tgame,strat]
highlights the game strategy strat.
Details and Options
- TreeGamePlot is typically used to communicate and understand a tree game.
- TreeGamePlot shows a game tree where each interior node represents a player, with the outgoing edges representing the possible actions that player can take. The leaf nodes represent game over with a payoff for each player.
- A tree game is plotted as a tree graph, where action nodes represent choices for a given player, and end nodes represent the end of the game and the consequent payoffs for all players:
- TreeGamePlot uses as a second argument a game strategy, which specifies the probability of each choice. For example, the strategy <"A" <{} {0.8, 0.2} >, "B" <{1} {0.4, 0.6}, {2} {0.1, 0.9} > > is shown by the shade of the actions (edges):
- Actions and players may be labeled. Some choices may be based on probabilities, denoted by the thickness of the actions:
- Some action nodes may not be distinguishable to a player. These nodes are thus part of the same information, where each information set is represented by a set of connected dashed edges.
- TreeGamePlot has the same options as Graphics, with the following additions and changes: [List of all options]
-
Appearance All choose to show probability and information sets ColorFunction Automatic color of the player nodes and payoffs EdgeLabelStyle Automatic style of the action labels EdgeWeight Automatic weights for edges GameActionLabels Automatic show the action labels GamePlayerLabels Automatic show the player labels GraphHighlight Automatic graph elements to highlight GraphHighlightStyle Automatic style for highlight GraphLayout "LayeredDigraphEmbedding" how to lay out vertices and edges PlotLegends False show legends PlotTheme Automatic overall theme for edges VertexCoordinates Automatic coordinates for vertices VertexLabelStyle Automatic style of the player labels - GraphLayout settings most relevant for TreeGamePlot are structured layouts for trees, including:
-
"BalloonEmbedding" vertices on a circle with the center at the parent vertex "RadialEmbedding" vertices on a circular segment "LayeredDigraphEmbedding" vertices on parallel lines for directed acyclic graphs "LayeredEmbedding" vertices on parallel lines -
AlignmentPoint Center the default point in the graphic to align with Appearance All choose to show probability and information sets AspectRatio Automatic ratio of height to width Axes False whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic ColorFunction Automatic color of the player nodes and payoffs ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool EdgeLabelStyle Automatic style of the action labels EdgeWeight Automatic weights for edges Epilog {} primitives rendered after the main plot FormatType TraditionalForm the default format type for text Frame False whether to put a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame ticks FrameTicksStyle {} style specifications for frame ticks GameActionLabels Automatic show the action labels GamePlayerLabels Automatic show the player labels GraphHighlight Automatic graph elements to highlight GraphHighlightStyle Automatic style for highlight GraphLayout "LayeredDigraphEmbedding" how to lay out vertices and edges GridLines None grid lines to draw GridLinesStyle {} style specifications for grid lines ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic LabelStyle {} style specifications for labels Method Automatic details of graphics methods to use PlotLabel None an overall label for the plot PlotLegends False show legends PlotRange All range of values to include PlotRangeClipping False whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotTheme Automatic overall theme for edges PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RotateLabel True whether to rotate y labels on the frame Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks VertexCoordinates Automatic coordinates for vertices VertexLabelStyle Automatic style of the player labels
List of all options
Examples
open allclose allBasic Examples (5)
Scope (3)
Options (12)
ColorFunction (1)
To change the colors of the player nodes and payoffs, change the ColorFunction option:
GraphHighlight (1)
To highlight vertices or edges, use GraphHighlight:
GraphHighlightStyle (1)
To change the style of the highlighted vertices or edges, use GraphHighlightStyle with GraphHighlight:
GraphLayout (1)
The default GraphLayout is the "LayeredDigraphEmbedding".
PlotLegends (1)
To show the payoff legend for each player, set PlotLegends to True:
PlotTheme (1)
To change the theme of the edges, use PlotTheme:
Appearance (1)
By default, TreeGamePlot shows both edge probability (lighter edges from the blue player) and information sets:
To show the probability edges without information sets, set Appearance to "ActionProbabilities":
To show the information sets without probabilities, set Appearance to "InformationSets":
Use None to show neither:
GameActionLabels (1)
To show the action labels, set GameActionLabels to Automatic:
To hide the action labels, set GameActionLabels to None:
Specify the individual labels using a list of GameActionLabels:
GamePlayerLabels (1)
To show the player labels, set GamePlayerLabels to Automatic:
To hide the player labels, set GamePlayerLabels to None:
VertexCoordinates (1)
To specify the coordinates of the tree nodes, use VertexCoordinates:
VertexLabelStyle (1)
To change the style of the player labels, set VertexLabelStyle to a style and specify the vertex label style:
Applications (6)
Economic Games (1)
Military Games (3)
The Escalation game is defined as follows. Two nations are in conflict. One nation has the choice to initiate or not initiate, and another nation has the choice to either acquiesce or escalate. Note a third player, "Nature", is often used to portray the randomness of the payoffs. This game is also called the "Nuclear" game, in reference to the atomic threats during the Cold War. Plot the game:
The Revolution game is as follows. A colony has the choice to either rebel or concede to the status quo. The country can either grant independence or suppress the rebellion. If the colony concedes to the status quo, the country can either tax or not tax the colony. This game is usually studied in cases where the payoffs for the suppressed rebellion are unknown. Plot the game:
The Naval Deployment game is an extension of the Battle of Bismarck game to an army that flees and another that is pursuing:
Social Games (2)
The Centipede game has two players who alternate in making decisions. At each turn, a player can choose between going "down" and ending the game or going "across" and continuing it (except at the last node, where going "across" also ends the game). The longer the game goes on, the higher the total payoff. However, a player who ends the game early will get a larger share. Generate that game:
The Beer-Quiche game is a signaling game defined as follows. An individual B is considering whether to duel with another individual A. B knows that A is either a wimp or is surly but not which. B would prefer a duel if A is a wimp but not if A is surly. Player A, regardless of type, wants to avoid a duel. Before making the decision, B has the opportunity to see whether A chooses to have beer or quiche for breakfast. Both players know that wimps prefer quiche while surly people prefer beer. Note a third player, "Nature", is often used to portray the randomness of the payoffs:
Text
Wolfram Research (2025), TreeGamePlot, Wolfram Language function, https://reference.wolfram.com/language/ref/TreeGamePlot.html.
CMS
Wolfram Language. 2025. "TreeGamePlot." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TreeGamePlot.html.
APA
Wolfram Language. (2025). TreeGamePlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TreeGamePlot.html