Zaslat SMS: A variational approach to structural analysis