Extension of Karmarkar’s algorithm for solving an optimization problem