The weighted complexity and the determinant functions of graphs