I am going in a very abstract layer for the problem, but I think this problem might be a common one so posting it.

So, what I am looking for is any ML algorithm or Data Science technique is there to create a relationship factor between different sets of goods.

I guess, its used heavily in social media, but here I am talking w.r.t. product goods context. Like suppose if we sell a bunch of products together in a store, so in collection there will be many products that are always bought together.

So, accordingly there will be a relationship factor between different products i.e. some product that are always bought together will have a higher factor than the one that are bought together less frequently.

So, is there any approach where we can tackle this problem to get the factor between two products using any technique?

Edit : Narrowing it down to a universe where all items are having same factors and their relationship factor to each other totally depends on their occurance together.