Developing techniques for optimal allocation of limited resources to a set of activities has received increasing attention in recent years. In this paper, an efficient resource allocation scheme based on particle swarm optimization (PSO) is developed. Different from many existing evolutionary algorithms for solving resource allocation problems (RAPs), this PSO algorithm incorporates a novel representation of each particle in the population and a comprehensive learning strategy for the PSO search process. The novelty of this representation lies in that the position of each particle is represented by a pair of points, one on each side of the constraint hyper-plane in the problem space. The line joining these two points intersects the constraint hyper-plane and their intersection point indicates a feasible solution. With the evaluation value of the feasible solution used as the fitness value of the particle, such a representation provides an effective way to ensure the equality resource constraints in RAPs are met. Without the distraction of infeasible solutions, the particle thus searches the space smoothly. In addition, particles search for optimal solutions by learning from themselves and their neighborhood using the comprehensive learning strategy, helping prevent premature convergence and improve the solution quality for multimodal problems. This new algorithm is shown to be applicable to both single-objective and multiobjective RAPs, with performance validated by a number of benchmarks and by a real-world bed capacity planning problem. Experimental results verify the effectiveness and efficiency of the proposed algorithm.