Update lpi for new graph. Add graph unit tests