Description Usage Arguments Value Examples
Given a graph with at least one minimum cost spanning tree,
mstGames
builds both cooperative games: the
pessimistic and the optimistic game.
The pessimistic game associated with a minimum cost spanning tree problem is a cooperative game in which every coalition of agents obtains the minimum cost assuming that the agents outside the coalition are not connected.
The optimistic game associated with with a minimum cost spanning tree problem is a cooperative game in which every coalition of agents obtains the minimum cost assuming that that the agents outside the coalition are connected. Thus, the agents in the coalition can benefit from their connections to the source
1 |
nodes |
vector containing the nodes of the graph, identified by a number that goes from 1 to the order of the graph. |
arcs |
matrix with the list of arcs of the graph. Each row represents one arc. The first two columns contain the two endpoints of each arc and the third column contains their weights. |
game |
denotes the game that we want to obtain: "pessimistic" or "optimistic". |
show.data |
logical value indicating if the function
displays the console output ( |
mstGames
returns a vector with the characteristic
fuction of the selected game associated with the graph and
prints the result in console.
1 2 3 4 5 6 7 |
Loading required package: igraph
Attaching package: 'igraph'
The following objects are masked from 'package:stats':
decompose, spectrum
The following object is masked from 'package:base':
union
Loading required package: optrees
v(S) = 6 10 6 10 12 10 14
$coalitions
[1] "1" "2" "3" "1,2" "1,3" "2,3" "1,2,3"
$values
[1] 6 10 6 10 12 10 14
v(S) = 4 4 4 8 8 8 14
$coalitions
[1] "1" "2" "3" "1,2" "1,3" "2,3" "1,2,3"
$values
[1] 4 4 4 8 8 8 14
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.