that there is a whole bunch of complex math and even more complex programming,
you need to give, WAY more info before any of us have even the tiniest insight in which direction to point you to,
also what do you mean by power flow algorithms, as power does not flow, i think what you mean is a system that can budget and control your power usage, e.g. dim the lights in a section where no one is present and relaxing the aircon on dormant floors, is this correct?
adaptive algorithms are something you really have to understand before you can correctly attempt to implement them, for the main reason that they self modify, so if you dont set up the correct constraints you end up with something that gets out of control,