Optimization methods in portfolio management and option hedging