Nonlinear Programming And Optimal Control Approach To The Study Of Social Network