Connected and autonomous vehicles are different from traditional vehicles. The communication between vehicles (V2V) or between vehicles and infrastructures (V2I) renders it possible to convey traffic information (e.g. signal timing or speed advisory) from signal controllers to vehicles as well as vehicles to vehicles in real time. Taking this advantage, this paper aims to developing an algorithm which enables the interconnected autonomous vehicles running efficiently on arterials. A set of driving rules determining random behavior and swarm behavior of autonomous vehicles is developed based on swarm intelligence theory. Under control of these rules, each autonomous vehicle follows the same rules, which make it select target vehicle from all the optimal individuals in detection zone according to characteristics of itself, then approach to the target by changing lane, following former car, or accelerating. The result of simulation shows that this swarm algorithm enables an autonomous vehicle to meet its own requirements quickly and form a stable platoon within 30 seconds. Due to the consistency of the individuals in a platoon, autonomous vehicle can maintain the small car-following gap. This decreases the fragmentation of road, thereby greatly advantages the form of platoons compared to individuals under high density circumstances. Moreover, it was found that the proposed swarm intelligence based algorithm increases the accessibility of arterial significantly.