Variation formulas and graphs