the only solution is to totally reset the device to factory defaults generally
this usually means putting the device into setup mode and connecting it to a PC to run a restore/update with the appropriate software - the relevant button presses vary from device to device so it would be a good idea to grab the manual from the samsung website to confirm the correct procedure
an alternative which isn't so destructive and not guarenteed is to look carefully at the screen at different angles under the light - if the code has been put in enough times previously and the screen not cleaned properly then you might see the pattern on the screen in the form of finger smudge marks, its just a matter of guessing/remembering where it starts and where it ends
i do have to play devils advocate and wonder why/how you managed to forget the unlock pattern for your phone - unless its not your phone in the first place....