modified algorithm: remove bmin function; add resource filter section

Signed-off-by: leetschau <leetschau@gmail.com>