Telecommunication carriers of 5G-MEC are re-architecting their central offices and mobile base stations as datacenters with network function virtualization (NFV) technology. These datacenters (DCs) are known as edge datacenters that help network operators speed deployment and reduce costs. Previously, the use of NFV was limited to within a datacenter (DC) known as intra-DC. Recently, many studies have been conducted into the use of NFV across DCs, i.e., inter-DC. However, these NFV inter-DC architectures have limited communication between DCs with either horizontal or vertical connectivity. In this paper, we propose a generic architecture of such edge NFV datacenters with both horizontal and vertical connectivity, and demonstrate the consequences of both vertical and horizontal connectivity between DCs in terms of communication and computing costs. We formulate a cost optimization problem with latency and capacity as constraints by estimating the traffic dispatch rate between DCs. We propose a vertical-horizontal communication (VHC) heuristic solution to the NP-hard problem. Compared to horizontal connectivity, our results show that vertical connectivity helps to reduce computing costs by 10-30%. However, both vertical and horizontal communications together can help to reduce such costs by 20-30% compared to only vertical communication.