# How to compute the prime ideal factorization of a given ideal in an algebraic ring

I have been working on a problem involving integral ideals in algebraic ring $\mathcal{O}_K$. And it involves the unique factorization of a integral ideal ${I}$ into product of powers of some prime ideals.
From the algorithmic point of view, I need to find the unique factorization of a given fraction ideal ${I}$, i.e., ${I}=\displaystyle\Pi_{i=1}^{m}{p_i^{e_i}}$, where every $P_i$ is prime in $\mathcal{O}_K$ and $e_i\geq 0$.

Naturally, this could be done in two steps:
Sub-problem 1: find all the prime factors $P_1,\cdots, P_m$ of ${I}$;
Sub-problem 2: for each $i\in \{1,\cdots, m\}$, find $e_i$.

In the sequel, we assume that an integral basis $B$ of $\mathcal{O}_K$ is given, and every element of $\mathcal{O}_K$ is represented by its associated coordinate relative to $B$.

My problem is, if we are given an integral ideal ${I}$ of some $\mathcal{O}_K$ in terms of its $\mathbb{Z}$-basis $U=\{u_1,\cdots, u_n\}\subset \mathcal{O}_k$, how to solve the preceeding two sub-problems (of course, the outputted prime factor $P_i$ is represented in terms of one of its $\mathbb{Z}$-bases as well)?

Furthermore, how to solve these two sub-problems when ${I}$ is a fractional ideal of $\mathcal{O}_K$?

Thanks!!