
Last chance! 50% off unlimited learning
Sale ends in
Get the overall costs/weight of a subgraph given its edgelist.
getWeight(graph, edgelist)
[numeric(2)
] Weight vector.
[mcGP
]
Multi-objective graph problem.
[matrix(2, k)
]
Matrix of edges (each column is one edge).
# generate a random bi-objective graph
g = genRandomMCGP(5)
# generate a random Pruefer code, i.e., a random spanning tree of g
pcode = sample(1:5, 3, replace = TRUE)
getWeight(g, prueferToEdgeList(pcode))
Run the code above in your browser using DataLab