Hello,
It is my understanding that you want to understand how to use branch and bound optimisation to solve a maximization problem.
You can refer to the documentation provided for the function intlinprog that can be used to solve mixed integer linear programming problems and uses branch and bound algorithm, there are examples of using the function in the same documentation. More details of the algorithm can be found in the documentation for Mixed Linear Programming Algorithms.