How Does Minheap does sorting

In This concept , we are maintaining heap which contains 3 things , mainly :-> element, element-index, array-index , in the 2d vector ,

I want to ask , on which basis value does minheap is build , we know on basis of element value , but how does it know , it have to build min heap on it , and Can we change it accordingly and How?

if not specified it sorts on the basis of first value thats y u keep element first as u want to sort on the basis of first
@yamangoyal100_ff74db54bdf01539