A novel resource sharing algorithm based on distributed construction