.maxcover
Among all itemsets in , return itemset with maximum cost as ZDD object
. Note that the weight is not taken into account when calculating the cost.
The value of cost is obtained by maxcost. Specify the cost with symbol function.
> require 'zdd' # Set the cost of each item. > ZDD::symbol("a",1.0) > ZDD::symbol("b",0.5) > ZDD::symbol("c",2.0) > a=ZDD::itemset("a") > b=ZDD::itemset("b") > c=ZDD::itemset("c") > f=a*b + b*c + c*a > f.show a b + a c + b c # Cost of a b =1.0+0.5=1.5 # Cost of b c =0.5+2.0=2.5 # Cost of a c =1.0+2.0=3.0 > puts f.maxcover a c > puts f.maxcost 3.0 > puts f.mincover a b > puts f.mincost 1.5
symbol : Declare items
cost : Total cost of itemsets
maxcost : Cost of itemset with maximum cost
mincover : Select itemset with minimum cost
mincost : Cost of itemset with minimum cost