1. A method for creating a vertical trajectory profile of an aircraft by optimization of a criterion representative of a flight cost in a computer of a flight management system or of an electronic flight bag, a trajectory being computed from an ordered list of waypoints contained in a flight plan, a vertical profile associated with the trajectory being defined by a plurality of successive altitude levels to be reached by the aircraft for each level: an altitude change point between a current level (i) and a next level (i+1), a plurality of speeds observing an aircraft speed trend law on the level considered; said method comprising: loading a portion of trajectory for which the profile is to be optimized into a computer of a flight management system or of an electronic flight bag, loading at least one criterion parameter into the computer of the flight management system or of the electronic flight bag, loading at least one value representative of permitted altitude levels into the computer of the flight management system or of the electronic flight bag, initializing a first iterative computation by an initial profile (Prof 0 ) by the computer of the flight management system or of the electronic flight bag, performing the first iterative computation of a profile free of altitude constraints as long as a condition dependent on the criterion is not reached by the computer of the flight management system or of the electronic flight bag, comprising the substeps: computing the criterion corresponding to the current profile using a function performing a digital integration of the trajectory with the computer of the flight management system or of the electronic flight bag, incrementing the parameters by a parametric optimization method with the computer of the flight management system or of the electronic flight bag, loading the constraint-free profile obtained as output from the first iterative computation, comprising a plurality of successive levels, and, for each level, an altitude change point and a plurality of speeds into the computer of the flight management system or of the electronic flight bag, replacing each free level of the constraint-free profile with a permitted level so as to generate an initial constrained profile, with the computer of the flight management system or of the electronic flight bag, comprising a plurality of permitted levels, and, for each level, an altitude change point and a plurality of speeds, loading the initial constrained profile to initialize a second iterative computation into the computer of the flight management system or of the electronic flight bag, performing the second iterative computation of a profile, with the computer of the flight management system or of the electronic flight bag, in which the altitude levels to be reached remain constant, equal to the initial permitted levels of the initial constrained profile, as long as a condition dependent on the criterion is not reached, comprising the substeps: computing the criterion corresponding to the current constrained profile using a function performing a digital integration of the trajectory, and incrementing the parameters by a parametric optimization method, displaying a final constrained vertical profile obtained as output from the second iterative computation, said display comprising at least a plurality of permitted successive levels, and, for each level, an altitude change point, and proposing to a pilot insertion of the computed final constrained vertical profile into a temporary flight plan.