An Optimal Algorithm to Detect Sign Compatibility of a Given Sigraph