Algorithm for charging LI-PO batteries?
Constant current of x amps (x is usually a fraction or multiple of capacity, e.g. 0.5C, 1C, 2C. Usually never any higher than 5C or cell heating results) until 4.2V ±0.5% is reached. This is called the "CC" stage.

Then a constant voltage of 4.2V ±0.5% is applied until charge current drops below a specific current, usually 0.2C to 0.05C. This is called "CV".

If cell voltage is below 2.8V, a precharge is performed at about 1/10 to 1/20 normal charge current until cell voltage reaches 2.8V; from then on CC takes over. Discharging a li-ion below 2.8V can usually cause a loss of capacity or permanent damage, so avoid doing it. Not all chargers implement pre-charging; some will refuse to charge over-discharged batteries.

This is for newer li-ion cells with 3.7V nominal voltages; for older ones with 3.6V nominal voltage, use 4.1V ±0.5% instead of 4.2V as the CV point.

This is per cell. For multi-cell packs at low charge currents, cells are charged in series. With higher charge currents, they are still charged in series but if they become out of balance, a balancer draws a small current from the appropriate cell to re-balance the pack. Some lower-current charges charge each cell separately, but this increases the cost.