Frienship Algorithm