3.33 maxcover : Select itemset with maximum cost

Format

$obj$.maxcover $\rightarrow $ $zdd$

Description

Among all itemsets in $obj$, return itemset with maximum cost as ZDD object $zdd$. 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.

Example

Example 1: Basic Example

> 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

See Also

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