B&G Foods is selling its Portland, Maine, manufacturing facility to the Institute for Digital Engineering and Life Sciences to cut costs and boost efficiencies at a time when the overall food and beverage industry is struggling with inflation and labor shortages that are slowing production and squeezing margins.