  Network Function Virtualization (NFV) is a promising virtualization
technology that has the potential to significantly reduce the expenses and
improve the service agility. NFV makes it possible for Internet Service
Providers (ISPs) to employ various Virtual Network Functions (VNFs) without
installing new equipments. One of the most attractive approaches in NFV
technology is a so-called Joint Placement and Allocation of Virtual Network
Functions (JPA-VNF) which considers the balance between VNF investment with
Quality of Services (QoS). We introduce a novel capability function to measure
the potential of locating VNF instances for each server in the proposed OJPA-HS
model. This model allows the servers in the network to be heterogeneous, at the
same time combines and generalizes many classical JPA-VNF models. Despite its
NP-hardness, we present a provable best-possible deterministic online algorithm
based on dynamic programming (DP). To conquer the high complexity of DP, we
propose two additional randomized heuristics, the Las Vegas (LV) and Monte
Carlo (MC) randomized algorithms, which performs even as good as DP with much
smaller complexity. Besides, MC is a promising heuristic in practice as it has
the advantage to deal with big data environment. Extensive numerical
experiments are constructed for the proposed algorithms in the paper.
