Adds to the chart by iteratively moving an edge from the agenda to the chart,
creating new edges for the agenda by applying available
rules, while updating the best edge found so far, until done,
or until the time limit (if any) is reached, or until the first complete
edge is found (if beyond the time limit, and according to the given flag).