A computer network system is a complex system with a great number of dynamic components. There are many devices in the system, such as computers, routers, lines, hubs, and switches. In addition to these hardware systems, many protocols are integrated to set the rules and provide the way of communication. Due to the nature of the system, it is hard to formulate and solve problems analytically without making any assumptions. One of the prominent problems that occur in computer systems is the line capacity assignment problem. In the previous mathematical models, message routes were predetermined and the dynamic nature of the system was neglected. This study deals with the line capacity assignment problem under a dynamically routing policy. Four different computer network topologies are used and solved by two heuristic algorithms via simulation. A dynamic search approach based on the occupancy rate of lines is used to define the consecutive routes of messages. The performances of harmony search and genetic algorithms via simulation are compared with the results of OptQuest, one of the optimization packet programs embedded in simulation software Arena®.