How to reduce layer spacing of a node

For any flow in tree layout, we give layerspacing to maintain space between consecutive nodes.

I want to reduce this layerspacing between two specific nodes,
Is there any way to achieve this ?

Yes, override TreeLayout.assignTreeVertexValues to set TreeVertex.layerSpacing to whatever you like depending on the LayoutVertex.node or LayoutVertex.node.data.