Firefly algorithm implementation