A solar flare triggering mechanism based on the Woltjer-Taylor minimum energy principle