WHAT IS PROJECT N.I.R.A.D.?
N.I.R.A.D. (Network Interdiction Resilience Advanced Defense) is a prototype developed in Python to explore how generative AI can make complex research more intuitive, interactive, and understandable for broader audiences.
The main objective of N.I.R.A.D. is to help assess and improve network resilience against malicious attacks. It is based on:
robust optimization methods (implemented with the Pyomo library and the GLPK solver)
Google Gemini LLM
agents (Huggingface Smolagents).
WHAT MOTIVATED N.I.R.A.D.?
Often research articles can seem obscure for non-experts. Potential impactful methodologies therefore remain hidden within the academic domain. Can AI bridge this gap, and make such results concretely available?
Starting from two research papers (see here and here) I wrote on the topic of network interdiction, I implemented the methodology described there for maximizing network resilience using agents and the Gemini LLM. This way, non-experts can ask relevant questions in a natural language - the same way you would interact with GPT - and N.I.R.A.D. will autonomously decide the function to run in order to answer the user's query, thereby reducing hallucinations.
This is also a Capstone Project for the Gen AI Intensive Course 2025 with Google, hosted by Kaggle.
If you want to know more, you can also have a look at this video!
WHICH PROBLEMS CAN N.I.R.A.D. SOLVE?
Someone said that a picture is worth a thousand words. What about two?
Network before fortification.
Network after fortification.
💡On the left, we have a directed network. The red node is the source. The green node is the terminal. We want to maximize the flow of some commodity from the source to the terminal. This flow can reach the terminal through arcs. Each arc is described by two numbers: the capacity (i.e., how much flow can go through that arc), and the cost that an attacker needs to pay to destroy that arc, (i.e., reduce the capacity to 0). If you solve the max flow problem, you will find out that you can send 9 units of commodity from the source to the terminal. Can you figure out the path?
🆘Imagine now that you have 10M$ of fortification budget that you can allocate to network arcs to make it more expensive to the attacker to destroy them. For example, if you allocate 1M$ to arc (1,3), the destruction cost is now 5.5M$. Now, say that you want to guarantee a flow of at least 6 units to the terminal. What is the best way to allocate your budget to the arcs so that it will be as expensive as possible for the attacker to prevent you from sending 6 units to the terminal?
✅On the right side you see the optimal solution (with tolerance 0.1). You allocate 4.2M$ to arc (s, 3) and 5.8M$ to arc (3, t). This way, each attack costing 8.7M$ or less would still allow you to send 6 units from the source to the terminal (you can try). The value 8.8 is called resilience, and it is the best you can do (you can again try). This is an example of what N.I.R.A.D. can do!
HOW DOES IT WORK IN PRACTICE?
The main idea is to code all relevant functions (e.g., how to find the max flow, how to find the worst-case attack, how to find the resilience) as tools that an agent can access. The agent is driven by an LLM (in this case, Google Gemini 2.0-flash), which interprets the user's query, decide the correct tool(s) to invoke and how to manipulate the retrieved output, and finally provide an answer to the user. Accurate tools description and prompts are also part of the mix. Below you see some examples of the code implemented. The full version can be found here.
Code snippet: definition of a tool to perform the worst-case attack computation.
Prompt: it is important to provide instructions.
This is how you can interact with N.I.R.A.D. from the console.
PROS, CONS, AND FUTURE WORK
✅ N.I.R.A.D. allows non-experts to access advanced research methodologies without having to understand all the implementation details. Moreover, it can accommodate diverse queries, thus overcoming the rigidity of built functions that require each variation of the input data to be coded.
Given that N.I.R.A.D. was originally based on the Gemini-2.0-Flash LLM, the risk of hallucination is quite low, as shown by the picture below! The base LLM will be updated when necessary (see History at the bottom of this page for more details).
🆘 Using tools reduces the hallucination phenomenon even more, and that is good. At the same time, things can still go unexpectedly during the reasoning steps, especially in data generation/manipulation. In case something is confusing, one can enable the reasoning steps visualization. For more structured projects, where the list of actions is more standardized, other libraries like LangChain may be more suitable.
💡The next step is the creation of a tool that can be shared, with a more functional interface for better interaction. Stay tuned for that. Also, by running an LLM locally, data privacy issues may be mitigated. Finally, other capabilities should be added, such as the generation of figures to summarize results and interaction through audio (yes, LLMs can speak, too).
If you have ideas, comments, suggestions, feel free to get in touch!
RELATED RESOURCES
Article 1 on network resilience optimization ▶️here
Article 2 on network resilience optimization ▶️here
My free short course on resilience for infrastructure systems ▶️go
The full version of the project hosted on Kaggle for the Gen AI Intensive Course 2025 with Google▶️go
The GitHub repository of the project ▶️here
A demo of the project hosted on the cloud ▶️go
History
23/1/26: version 0.9.1 - Changed base LLM to Gemini 2.5 due to discontinued support.
16/4/25: version 0.9 - First version
Thanks to: Assoc. Prof. T.S. Ng, Prof. M. Sim (National University of Singapore) for the collaboration on the topic of network interdiction.