To exploit the attractive features of CDMA systems and the tremendous bandwidth provided by optical communication such as fiber, VLC, and Li-FI channel, a new system is emerging and is known as optical code division multiple access. These systems require optical orthogonal codes (OOCs). This paper presents an algorithm to design OOCs and determines the auto-correlation (k a ) and cross-correlation (k c ) constrains of codes. The grouping of these OOCs for desired k a and k c is done using a low complexity bipartite method. Design of codes, groups, and simulation for performance analysis in terms of multiple access interference is done using MATLAB programming. The bipartite scheme for grouping finds all possible groups and it reduced the time of computation. The memory requirement of the scheme is also reduced together with computational complexity.