Videos (Hands-on)

The C++ version of a series for beginners: type a program into the C++ Playground in your browser, run it, look at the result, and then learn what happened. No compiler has to be set up, so you can type along with the videos. The same episodes in Python are on the Python version of this page. They are published on the YouTube channel QUBO++ and collected, together with the Python version, in the playlist QUBO++ Hands-on (English). Click an image to play the video on this page. Videos that explain QUBO++ systematically are on the Videos (Tutorials) page, and videos that solve concrete problems are on the Videos (Case Studies) page.

QUBO++ Hands-on #1: Making and Tidying Expressions (C++)(8:06, YouTube)Type a program into the C++ Playground, press Compile and Run, and learn from the output: #include, the main function and qbpp::var, the square of (2x+3y-2) in variables x and y, expanded automatically, tidied up with qbpp::simplify, qbpp::simplify_as_binary and qbpp::sqr, and evaluated for given values of the variables.
QUBO++ Hands-on #2: Solving with a Solver (C++)(5:46, YouTube)qbpp::ExhaustiveSolver finds the values that make the square of (x+2y+3z-3) from episode 1 smallest: the solution printed with std::cout, sol(x) and sol.energy(), every best solution with best_energy_sols and every solution with all_sols, then a switch to EasySolver by changing the header and the solver name, and a comparison of the two solvers.
QUBO++ Hands-on #3: Arrays of Variables (C++)(6:03, YouTube)An array of variables splits eight numbers into two groups with equal sums: qbpp::var with a name and a count makes the array, qbpp::array and qbpp::sum give the sums P and Q of the two groups, and ExhaustiveSolver minimizes the square of (P − Q). sol(x) takes out the values of the array, all the best solutions are shown, and EasySolver splits the forty numbers from 1 to 40, made with std::vector and a for loop.
QUBO++ Hands-on #4: Constraints (C++)(5:09, YouTube)Choose from ten items the most valuable choice with a total weight of 50 or less (the knapsack problem): minimize the total value with a minus sign, add the weight constraint with qbpp::cons, and see how the value of a constraint and its weight act on the expression. sol.energy() and f.cons(sol) are printed, a small weight lets a solution that breaks the constraint win, and a constraint on the number of items is added.

Back to top

Page last modified: 2026.11.05.

© 2026 Koji Nakano, Hiroshima University