Locality preserving projection (LPP) has been often used as a dimensionality reduction tool for hyperspectral image analysis especially in the context of classification since it provides a projection matrix for embedding test samples to low dimensional space. However, the performance of LPP heavily depends on the optimization of two parameters of the graph affinity matrix: k-nearest neighbor and heat kernel width, when one considers an isotropic kernel. These two parameters might be optimally chosen simply based on a grid search. In case of using a generalized heat kernel where each feature is separately weighted by a kernel width, the number of parameters that need to be optimized is related to the number of features of the dataset, which might not be very easy to tune. Therefore, in this article, we propose to use heuristic methods, including genetic algorithm (GA), harmony search (HS), and particle swarm optimization (PSO), to explore the effects of the heat kernel parameters aiming to analyze the embedding quality of LPP's projection in terms of various aspects, including 1-NN classification accuracy, locality preserving power, and quality of the graph affinity matrix. The results obtained with the experiments on three hyperspectral datasets show that HS performs better than GA and PSO in optimizing the parameters of the affinity matrix, and the generalized heat kernel achieves better performance than the isotropic kernel. Additionally, a feature selection application is performed by using the kernel width of the generalized heat kernel for each heuristic method. The results show that very promising results are obtained in comparison with the state-of-the-art feature selection methods.